diff --git a/.install/2b-configure_gammu.sh b/.install/2b-configure_gammu.sh index 8884b01..5e84ddc 100755 --- a/.install/2b-configure_gammu.sh +++ b/.install/2b-configure_gammu.sh @@ -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 diff --git a/.install/4b-install_playsms.sh b/.install/4b-install_playsms.sh index 594d638..6e5db09 100755 --- a/.install/4b-install_playsms.sh +++ b/.install/4b-install_playsms.sh @@ -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 diff --git a/.install/templates/rc.local b/.install/templates/rc.local new file mode 100644 index 0000000..7d39ed7 --- /dev/null +++ b/.install/templates/rc.local @@ -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 diff --git a/debug/GSM_powerkey.sh b/debug/GSM_powerkey.sh index 9a4e357..91f4e71 100755 --- a/debug/GSM_powerkey.sh +++ b/debug/GSM_powerkey.sh @@ -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