SHARE
TWEET

Untitled

a guest Apr 9th, 2017 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2. #
  3. # /etc/rc.d/sshd: start/stop ssh daemon
  4. #
  5.  
  6. SSD=/sbin/start-stop-daemon
  7. PROG=/usr/bin/startx
  8. PID=/var/run/x11.pid
  9.  
  10. case $1 in
  11. start)
  12.     $SSD --start --pidfile $PID --exec $PROG
  13.     ;;
  14. stop)
  15.     $SSD --stop --retry 10 --pidfile $PID
  16.     ;;
  17. restart)
  18.     $0 stop
  19.     $0 start
  20.     ;;
  21. status)
  22.     $SSD --status --pidfile $PID
  23.     case $? in
  24.     0) echo "$PROG is running with pid $(cat $PID)" ;;
  25.     1) echo "$PROG is not running but the pid file $PID exists" ;;
  26.     3) echo "$PROG is not running" ;;
  27.     4) echo "Unable to determine the program status" ;;
  28.     esac
  29.     ;;
  30. *)
  31.     echo "usage: $0 [start|stop|restart|status]"
  32.     ;;
  33. esac
  34.  
  35. # End of file
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top