-
-
Save hidsh/1387640 to your computer and use it in GitHub Desktop.
sample of startup script for debian 6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: startup test | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: test for startup script. | |
# Description: test for startup script. | |
### END INIT INFO | |
# install: | |
# 1. put this file into /etc/init.d/test | |
# 2. chmod +x test | |
# 3. update-rc.d test defaults | |
# | |
# uninstall: | |
# update-rc.d test remove | |
start() { | |
echo -n "Starting test-daemon: test start" | |
# do something | |
echo "." | |
return 0 | |
} | |
stop() { | |
echo -n "Stopping test-daemon: test stop" | |
# do something | |
echo "." | |
return 0 | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
esac | |
# this file ends here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment