Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata
nano /etc/init.d/[script]
 /etc/init.d/[script]
#! /bin/sh
# This is a generic Init Script
# This is a comment/note

#Edit these variables!
#variable1=


case "$1" in
  start)
    echo "Description of code for script starting"
    [command1]
    [command2]
    ;;
  stop)
    echo "Description of code run when stopping/shutting down script"
    [command1]
    [command2]
    ;;
  *)
    echo "Usage: /etc/init.d/[script] {start|stop}"
    exit 1
    ;;
esac

exit 0

Install and {start|stop}

chmod +x /etc/init.d/[script]
update-rc.d /etc/init.d/[script] defaults
/etc/init.d/[script] start
  • No labels