Install: Add rc.local config for GSM_powerkey
This commit is contained in:
parent
face5133ec
commit
3468ca60e5
|
@ -30,6 +30,12 @@ fi
|
|||
|
||||
## Configure rc.local
|
||||
|
||||
if [[ ! -f /etc/rc.local ]]; then
|
||||
sudo cp $MY_PATH/template/rc.local /etc/
|
||||
else
|
||||
[[ ! $(grep "exit 0" /etc/rc.local) ]] && echo "exit 0" | tee -a /etc/rc.local
|
||||
fi
|
||||
|
||||
sudo sed -i "/exit 0/i $GPATH/debug/GSM_powerkey.sh\ngammu-smsd-inject TEXT \"0647683646\" -text \"G1sms Plus démarré.\"" /etc/rc.local
|
||||
|
||||
exit 0
|
||||
|
|
|
@ -54,7 +54,7 @@ sudo /usr/local/bin/playsmsd start
|
|||
if [[ -f /etc/rc.local ]]; then
|
||||
[[ ! $(grep playsmsd /etc/rc.local) ]] && sudo sed -i '/^exit 0.*/i /usr/local/bin/playsmsd start' /etc/rc.local
|
||||
else
|
||||
echo "/usr/local/bin/playsmsd start" | sudo tee /etc/rc.local
|
||||
echo "/usr/local/bin/playsmsd start" | sudo tee -a /etc/rc.local
|
||||
fi
|
||||
|
||||
## Tests
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/sh -e
|
||||
#
|
||||
# rc.local
|
||||
#
|
||||
# This script is executed at the end of each multiuser runlevel.
|
||||
# Make sure that the script will "exit 0" on success or any other
|
||||
# value on error.
|
||||
#
|
||||
# In order to enable or disable this script just change the execution
|
||||
# bits.
|
||||
#
|
||||
# By default this script does nothing.
|
||||
|
||||
# Print the IP address
|
||||
_IP=$(hostname -I) || true
|
||||
if [ "$_IP" ]; then
|
||||
printf "My IP address is %s\n" "$_IP"
|
||||
fi
|
||||
|
||||
exit 0
|
|
@ -9,8 +9,8 @@ if [ ! -e /sys/class/gpio/gpio4 ]; then
|
|||
fi
|
||||
|
||||
echo "out" > /sys/class/gpio/gpio4/direction
|
||||
echo "0" > /sys/class/gpio/gpio4/value
|
||||
sleep 3
|
||||
#echo "0" > /sys/class/gpio/gpio4/value
|
||||
#sleep 3
|
||||
echo "1" > /sys/class/gpio/gpio4/value
|
||||
|
||||
sleep 3 && $MY_PATH/gammu-restart.sh
|
||||
|
|
Loading…
Reference in New Issue