mirror of
https://github.com/FunKey-Project/FunKey-OS.git
synced 2026-03-20 10:52:44 +01:00
new fkgpiod package instead of previous gpiomanager
This commit is contained in:
35
FunKey/package/fkgpiod/etc/init.d/S11gpio
Normal file
35
FunKey/package/fkgpiod/etc/init.d/S11gpio
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Start/stop FunKey GPIO daemon
|
||||
#
|
||||
|
||||
DAEMON=/usr/local/sbin/fkgpiod
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting FunKey GPIO daemon: "
|
||||
${DAEMON} -d /etc/fkgpiod.conf > /dev/null 2>&1
|
||||
if [ ${?} -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "ERROR"
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
echo -n "Stopping FunKey GPIO daemon: "
|
||||
${DAEMON} -k > /dev/null 2>&1
|
||||
if [ ${?} -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "ERROR"
|
||||
fi
|
||||
;;
|
||||
restart)
|
||||
${0} stop
|
||||
sleep 1 # Prevent race condition: ensure FunKey GPIO daemon stops before start.
|
||||
${0} start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: ${0} {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
Reference in New Issue
Block a user