Guest User

Untitled

a guest
Nov 11th, 2014
447
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. cat /etc/init.d/sandfox
  2. #!/bin/sh
  3. ### BEGIN INIT INFO
  4. # Provides: sandfox
  5. # Required-Start: $local_fs $network
  6. # Required-Stop: $local_fs
  7. # Default-Start: 2 3 4 5
  8. # Default-Stop: 0 1 6
  9. # Short-Description: sandfox
  10. # Description: Sandfox boot startup script for Ubuntu and similar
  11. ### END INIT INFO
  12.  
  13. #!/bin/bash
  14.  
  15. sandfoxuser=gnomek
  16. sandfoxprofile=firefox
  17. sandfoxbin=/usr/local/bin/sandfox
  18.  
  19. start() {
  20. echo -n "Starting Sandfox: "
  21. $sandfoxbin --profile $sandfoxprofile --sandbox $sandfoxprofile --user=$sandfoxuser
  22. if [ $? -gt 0 ]; then
  23. echo "failure"
  24. RETVAL=$?
  25. else
  26. echo "success"
  27. RETVAL=0
  28. fi
  29. }
  30.  
  31. stop() {
  32. echo -n "Stopping Sandfox: "
  33. $sandfoxbin --closeall --user $sandfoxuser
  34. if [ $? -gt 0 ]; then
  35. echo "failure"
  36. RETVAL=$?
  37. else
  38. echo "success"
  39. RETVAL=0
  40. fi
  41. }
  42.  
  43. case "$1" in
  44. start)
  45. start
  46. ;;
  47. stop)
  48. stop
  49. ;;
  50. restart)
  51. stop
  52. sleep 3
  53. start
  54. ;;
  55. *)
  56. echo "Usage: $0 {start|stop|restart}"
  57. RETVAL=1
  58. esac
  59. exit $RETVAL
Advertisement
Add Comment
Please, Sign In to add comment