Skip to content

Instantly share code, notes, and snippets.

@alx
Last active August 29, 2015 14:02
Show Gist options
  • Save alx/2b57cc8f840b65f14828 to your computer and use it in GitHub Desktop.
Save alx/2b57cc8f840b65f14828 to your computer and use it in GitHub Desktop.
videoprojector.sh
#!/bin/bash
#
# chkconfig: 35 90 12
# description: Videoprojector start/stop
#
# Get function from functions library
. /etc/init.d/functions
# Start the videoprojector
start() {
initlog -c "echo -n Starting videoprojector: "
# envoi d'une commande <cr>*pow=on#<cr> sur le port /dev/ttyUSB0
echo
}
# Stop the videoprojector
stop() {
initlog -c "echo -n Stopping videoprojector: "
# envoi d'une commande <cr>*pow=off#<cr> sur le port /dev/ttyUSB0
echo
}
### main logic ###
case "$1" in
start)
start
;;
stop)
stop
;;
status)
;;
restart|reload|condrestart)
stop
start
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status}"
exit 1
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment