Интересное

Сообщение об ошибке

Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in drupal_environment_initialize() (line 684 of /home/www/nixtalk.com/includes/bootstrap.inc).

Netams4 startup

Опубликовано вт, 12/03/2013 - 11:31 пользователем Demontager

Запускает службу Netams4

Особенности
1. Есть start, stop, restart и status для сервисов
2. Подсказки для админок

  1. #!/bin/bash
  2. #Date: 09.07.2013
  3. #author: demontager http://nixtalk.com
  4. #Netams4 startup script
  5.  
  6. NPATH=/usr/local/netams4
  7.  
  8. check_root() {
  9. if [[ ! $(whoami) = "root" ]]; then
  10. echo "Please run script as root"
  11. exit 1
  12. fi
  13. }
  14.  
  15. start() {
  16. check_root
  17. local PID=$(ps ax|grep netams4.properties|grep preferIPv4Stack|awk '{print $1;}')
  18. if [ -z "$PIDS" ]; then
  19. cd $NPATH/jserver && sh jserver-startup.sh && cd $NPATH/webadmin && sh webadmin-startup.sh && cd $NPATH/repserver && sh repserver-startup.sh
  20. local CHECK=`echo $?`
  21. if [ $CHECK = 0 ]; then
  22. echo "Netams4 successfully started"
  23. else
  24. echo "Error starting Netams4"
  25. fi
  26. else
  27. echo "Netams4 already running"
  28. fi
  29. }
  30.  
  31.  
  32. stop() {
  33. check_root
  34. local PID=$(ps ax|grep netams4.properties|grep preferIPv4Stack|awk '{print $1;}')
  35. if [ -n "$PID" ]; then
  36. for i in $PID
  37. do kill $i
  38. done
  39. local array=( $PID )
  40. echo "Netams4 processes stopped: ${array[@]}"
  41. else
  42. echo "Netams4 not running"
  43. fi
  44. }
  45.  
  46. status() {
  47. local PID=$(ps ax|grep netams4.properties|grep preferIPv4Stack|awk '{print $1;}')
  48. local array=( $PID )
  49. if [ -n "$PID" ]; then
  50. echo "Netams running: ${array[@]}"
  51. cat << EOF
  52.  
  53. User:
  54. http://localhost:8080
  55.  
  56. Admin:
  57. http://localhost:8080/webadmin/webadmin.html
  58. EOF
  59. else
  60. echo "Netams4 not running"
  61. fi
  62. }
  63.  
  64. case "$1" in
  65. start)
  66. start
  67. ;;
  68. stop)
  69. stop
  70. ;;
  71. restart)
  72. stop
  73. sleep 2
  74. start
  75. ;;
  76. status)
  77. status
  78. ;;
  79. *)
  80. echo "Usage: `basename $0` (start|stop|restart|status)"
  81. exit 1
  82. ;;
  83. esac
Поделится: 

Добавить комментарий