Changeset 260 for tools/routingservice/trunk/routingservice.sh
- Timestamp:
- 02/13/09 11:31:19 (19 months ago)
- Files:
-
- 1 modified
-
tools/routingservice/trunk/routingservice.sh (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tools/routingservice/trunk/routingservice.sh
r259 r260 19 19 case $1 in 20 20 start) 21 echo "\nService starting ..." 21 22 echo " 23 Service starting ..." 22 24 23 25 if [ -e "$pidfile" ] 24 26 then 25 echo "Service is already running!" 26 echo "Do nothing ... \n[$pidfile]\n\n" 27 28 echo "Service is already running!" 29 echo "Do nothing ... 30 [$pidfile] 31 32 " 27 33 else 28 34 $PROGRAM & 29 35 PID=$! 30 36 echo $PID > "$pidfile" 31 echo "Service started! \n[$pidfile|$PID]\n\n" 37 38 echo "Service started! 39 [$pidfile|$PID] 40 41 " 32 42 fi 33 43 ;; 34 44 35 45 restart) 36 echo "\nService restarting ..." 46 47 echo " 48 Service restarting ..." 37 49 38 50 if [ -e "$pidfile" ] … … 41 53 kill -9 $pid2kill 42 54 rm $pidfile 43 echo "Service stopped!" 55 56 echo "Service stopped!" 57 44 58 else 45 echo "No existing service found ... starting a new one!" 59 60 echo "No running service found ... starting a new one!" 61 46 62 fi 47 63 … … 49 65 PID=$! 50 66 echo $PID > "$pidfile" 51 echo "Service started! \n[$pidfile|$PID]\n\n" 67 68 echo "Service started! 69 [$pidfile|$PID] 70 71 " 52 72 ;; 53 73 … … 58 78 kill -9 $pid2kill 59 79 rm $pidfile 60 echo "\nService stopped! \n[$pid2kill]\n\n" 80 81 echo " 82 Service stopped! 83 [$pid2kill] 84 85 " 61 86 else 62 echo "\nNo service found!\n\n" 87 echo " 88 No service found! 89 90 " 63 91 fi 64 92 ;; … … 66 94 debug) 67 95 # run the program as is 68 echo "\nService starting in DEBUG mode ..." 69 echo "Type CTRL-C to stop the service\n\n" 96 echo " 97 Service starting in DEBUG mode ... 98 Type CTRL-C to stop the service. 99 100 " 70 101 $PROGRAM 71 102 ;; 72 103 73 104 help) 74 echo "\nThis is the Webrouting Service startup script \n" 75 76 echo "Usage:\n ./routingservice.sh {start|stop|restart|debug|help} [identifier]\n" 77 78 echo "Commands:" 79 echo " start Start the service" 80 echo " stop Stop the service" 81 echo " restart Stop and immediately start the service again" 82 echo " debug Run the service in debug mode" 83 echo " This will print log messages to the terminal window." 84 echo " help Show the startup help\n" 85 86 echo "Optional:" 87 echo " identifier Run the service as a distinct process.\n\n" 105 echo " 106 This is the Webrouting Service startup script 107 108 Usage: 109 ./routingservice.sh {start|stop|restart|debug|help} [identifier] 110 111 Commands: 112 start Start the service 113 stop Stop the service 114 restart Stop and immediately start the service again 115 debug Run the service in debug mode 116 This will print log messages to the terminal window. 117 help Show the startup help 118 119 Optional: 120 identifier Run the service as a distinct process. 121 122 " 88 123 ;; 89 124 90 125 *) 91 echo "\n Usage: ./routingservice.sh {start|stop|restart|debug|help}\n" 126 echo " 127 Usage: ./routingservice.sh {start|stop|restart|debug|help} 128 129 " 92 130 ;; 93 131 esac
