Return to Snippet

Revision: 33199
at May 26, 2011 08:38 by dalcacer


Updated Code
#! /bin/sh

### BEGIN INIT INFO
# Provides:          app_d
# Required-Start:    
# Required-Stop:   
# Should-Start:      app_d
# Default-Start:     3
# Default-Stop:      1
# Short-Description: provides a daemonlike execution of xyz
# Description:       provides a daemonlike execution of xyz
### END INIT INFO
#VERSION 0.2
#AUTHOR [email protected]

start_something(){
  #start an application using
  # &
  # nohup
  # ... and so on
}

stop_something(){
  killall process_name
}
case "$1" in
    start)
      start_something
    ;;
    stop)
      stop_something
    ;;
    restart|force-reload)
      stop_something
      start_something
    ;;
    *)
      echo "missing parameter start | stop | restart"
    exit 1
    ;;
esac

exit 0

Revision: 33198
at October 7, 2010 01:33 by dalcacer


Initial Code
#!/bin/sh
# Start asterisk

case "$1" in
start)  echo -n "Starting asterisk"
        /usr/sbin/asterisk
        echo "."
        ;;
*)      echo "Usage: /etc/init.d/asterisk start"
        exit 1
        ;;
esac
exit 0

Initial URL


Initial Description


Initial Title
init.d Template

Initial Tags


Initial Language
Bash