OliveTin 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #!/bin/bash
  2. #
  3. # olivetin Start/Stop OliveTin
  4. #
  5. # chkconfig: 2345 55 25
  6. # description: SSH is a protocol for secure remote shell access. \
  7. # This service starts up the OpenSSH server daemon.
  8. #
  9. # processname: OliveTin
  10. ### BEGIN INIT INFO
  11. # Provides: OliveTin
  12. # Required-Start: $local_fs $network $syslog
  13. # Required-Stop: $local_fs $syslog
  14. # Should-Start: $syslog
  15. # Should-Stop: $network $syslog
  16. # Default-Start: 2 3 4 5
  17. # Default-Stop: 0 1 6
  18. # Short-Description: Start/Stop OliveTin
  19. # Description: OliveTin is an app to run your Linux shell commands from a web interface.
  20. #
  21. ### END INIT INFO
  22. # source function library
  23. . /etc/rc.d/init.d/functions
  24. RETVAL=0
  25. prog="OliveTin"
  26. lockfile=/var/lock/subsys/$prog
  27. runlevel=$(set -- $(runlevel); eval "echo \$$#" )
  28. start()
  29. {
  30. echo -n $"Starting $prog: "
  31. /usr/local/bin/OliveTin $OPTIONS &
  32. RETVAL=$?
  33. return $RETVAL
  34. }
  35. stop()
  36. {
  37. echo -n $"Stopping $prog: "
  38. killall OliveTin
  39. RETVAL=$?
  40. return $RETVAL
  41. }
  42. status() {
  43. PID=$(pidof OliveTin)
  44. RETVAL=$?
  45. if [ $RETVAL -eq 1 ] ; then
  46. echo "OliveTin is stopped"
  47. else
  48. echo "OliveTin is running"
  49. fi
  50. return $RETVAL
  51. }
  52. restart() {
  53. stop
  54. start
  55. }
  56. case "$1" in
  57. start)
  58. start
  59. ;;
  60. stop)
  61. stop
  62. ;;
  63. status)
  64. status
  65. ;;
  66. *)
  67. echo $"Usage: $0 {start|stop|status|restart}"
  68. RETVAL=2
  69. esac
  70. exit $RETVAL