Skip to content

Instantly share code, notes, and snippets.

@karaage0703
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karaage0703/416050932dd22bebcc92 to your computer and use it in GitHub Desktop.
Save karaage0703/416050932dd22bebcc92 to your computer and use it in GitHub Desktop.
shutdown auto boot script for Nakayoshi camera
### 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