Last active
August 29, 2015 14:02
-
-
Save alx/2b57cc8f840b65f14828 to your computer and use it in GitHub Desktop.
videoprojector.sh
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
#!/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