Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cat /etc/init.d/sandfox
- #!/bin/sh
- ### BEGIN INIT INFO
- # Provides: sandfox
- # Required-Start: $local_fs $network
- # Required-Stop: $local_fs
- # Default-Start: 2 3 4 5
- # Default-Stop: 0 1 6
- # Short-Description: sandfox
- # Description: Sandfox boot startup script for Ubuntu and similar
- ### END INIT INFO
- #!/bin/bash
- sandfoxuser=gnomek
- sandfoxprofile=firefox
- sandfoxbin=/usr/local/bin/sandfox
- start() {
- echo -n "Starting Sandfox: "
- $sandfoxbin --profile $sandfoxprofile --sandbox $sandfoxprofile --user=$sandfoxuser
- if [ $? -gt 0 ]; then
- echo "failure"
- RETVAL=$?
- else
- echo "success"
- RETVAL=0
- fi
- }
- stop() {
- echo -n "Stopping Sandfox: "
- $sandfoxbin --closeall --user $sandfoxuser
- if [ $? -gt 0 ]; then
- echo "failure"
- RETVAL=$?
- else
- echo "success"
- RETVAL=0
- fi
- }
- case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- restart)
- stop
- sleep 3
- start
- ;;
- *)
- echo "Usage: $0 {start|stop|restart}"
- RETVAL=1
- esac
- exit $RETVAL
Advertisement
Add Comment
Please, Sign In to add comment