123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #!/bin/sh
- #
- # mpsweb servisi.
- BIN=/opt/mpsweb/mpsweb.py
- PID=/var/run/mpweb.pid
- DAEMON_USER=root
- mpsweb_start() {
-
- if [ -s $PID ]; then
- echo "mpsweb zaten calisiyor!"
- exit 1
- fi
- echo "mpsweb baslatiliyor..."
- if [ -x $BIN ]; then
- #$BIN & echo $! > $PID
- start-stop-daemon --start --background --pidfile $PID --startas $BIN --make-pidfile
- fi
- }
- mpsweb_stop() {
- echo "mpsweb kapatiliyor..."
- kill -9 $(cat $PID) && rm -rf $PID
- }
- mpsweb_restart() {
- mpsweb_stop
- sleep 3
- mpsweb_start
- }
- case "$1" in
- start)
- mpsweb_start
- ;;
- stop)
- mpsweb_stop
- ;;
- restart)
- mpsweb_restart
- ;;
- *)
- echo "kullanım: `basename $0` {start|stop|restart}"
- esac
|