Advertisement
Guest User

Untitled

a guest
Jul 8th, 2013
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. #! /bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides: logkeys
  4. # Required-Start: $remote_fs
  5. # Required-Stop: $remote_fs
  6. # Default-Start: 2 3 4 5
  7. # Default-Stop: 0 1 6
  8. # Short-Description: Start the logkeys keylogger.
  9. ### END INIT INFO
  10.  
  11.  
  12. PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
  13. DAEMON=/usr/bin/logkeys
  14. DAEMON_OPTS=""
  15. NAME=logkeys
  16. DESC=logkeys
  17.  
  18. test -x $DAEMON || exit 0
  19.  
  20. # Include logkeys defaults if available
  21. if [ -f /etc/default/logkeys ] ; then
  22. . /etc/default/logkeys
  23. fi
  24.  
  25. # Quit quietly, if $ENABLED is 0.
  26. test "$ENABLED" != "0" || exit 0
  27.  
  28. DAEMON_OPTS="-s -d $DEVICE -o $LOGFILE $DAEMON_OPTS"
  29.  
  30. set -e
  31.  
  32. case "$1" in
  33. start)
  34. echo -n "Starting $DESC: "
  35. start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid.lock \
  36. --exec $DAEMON -- $DAEMON_OPTS
  37. echo "$NAME."
  38. ;;
  39. stop)
  40. echo -n "Stopping $DESC: "
  41. start-stop-daemon --stop --oknodo --quiet --exec $DAEMON
  42. echo "$NAME."
  43. ;;
  44. #reload)
  45. #
  46. # If the daemon can reload its config files on the fly
  47. # for example by sending it SIGHUP, do it here.
  48. #
  49. # If the daemon responds to changes in its config file
  50. # directly anyway, make this a do-nothing entry.
  51. #
  52. # echo "Reloading $DESC configuration files."
  53. # start-stop-daemon --stop --signal 1 --quiet --pidfile \
  54. # /var/run/$NAME.pid.lock --exec $DAEMON
  55. #;;
  56. restart|force-reload)
  57. #
  58. # If the "reload" option is implemented, move the "force-reload"
  59. # option to the "reload" entry above. If not, "force-reload" is
  60. # just the same as "restart".
  61. #
  62. echo -n "Restarting $DESC: "
  63. start-stop-daemon --stop --oknodo --quiet --pidfile \
  64. /var/run/$NAME.pid.lock --exec $DAEMON
  65. sleep 1
  66. start-stop-daemon --start --quiet --pidfile \
  67. /var/run/$NAME.pid.lock --exec $DAEMON -- $DAEMON_OPTS
  68. echo "$NAME."
  69. ;;
  70. *)
  71. N=/etc/init.d/$NAME
  72. # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
  73. echo "Usage: $N {start|stop|restart|force-reload}" >&2
  74. exit 1
  75. ;;
  76. esac
  77.  
  78. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement