Create ssdled.sh

This commit is contained in:
manuelkamp 2021-12-21 23:06:56 +01:00 committed by GitHub
parent ef82f924b3
commit 3050254bed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 48 additions and 0 deletions

48
ssdled.sh Normal file
View File

@ -0,0 +1,48 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: ssdled
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts & Stops ssdled
# Description: Starts & Stops ssdled
### END INIT INFO
start () {
/usr/bin/ssdled -d
touch /var/lock/subsys/ssdled
}
stop () {
killall ssdled
rm -f /var/lock/subsys/ssdled
}
#Switch case fuer den ersten Parameter
case "$1" in
start)
#Aktion wenn start uebergeben wird
start
echo "Starte ssdled"
;;
stop)
#Aktion wenn stop uebergeben wird
stop
echo "Stoppe ssdled"
;;
restart)
#Aktion wenn restart uebergeben wird
stop
start
echo "Restarte ssdled"
;;
*)
#Standard Aktion wenn start|stop|restart nicht passen
echo "(start|stop|restart)"
;;
esac
exit 0