Install: Add rc.local config for GSM_powerkey

This commit is contained in:
poka 2020-01-01 07:40:38 +01:00
parent 3e226ac676
commit c8cc511cd3
4 changed files with 29 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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