Last active
August 29, 2015 14:06
-
-
Save karaage0703/416050932dd22bebcc92 to your computer and use it in GitHub Desktop.
shutdown auto boot script for Nakayoshi camera
This file contains 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
### BEGIN INIT INFO | |
# Provides: camera_shutdown | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start Camera Shutdown Server at boot time | |
# Description: Start Camera Shutdown Server at boot time | |
### END INIT INFO | |
#! /bin/sh | |
# /etc/init.d/camera_shutdown | |
PIDFILE=/var/run/camera_shutdown.pid | |
case "$1" in | |
start) | |
if [ -f $PIDFILE ]; then | |
echo $PIDFILE exists. | |
exit 1 | |
fi | |
start-stop-daemon -S -x /usr/local/sbin/camera_shutdown.sh -b -m -p $PIDFILE | |
;; | |
stop) | |
if [ ! -f $PIDFILE ]; then | |
echo $PIDFILE not found. | |
exit 1 | |
fi | |
start-stop-daemon -K -p $PIDFILE | |
rm $PIDFILE | |
;; | |
*) | |
echo "Usage: /etc/init.d/shutdown-button {start|stop}" | |
exit 1 | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment