structured scripts

This commit is contained in:
2014-02-18 16:11:18 +00:00
parent 4ea879d517
commit eab0f043fa
6 changed files with 41 additions and 14 deletions

View File

@@ -0,0 +1,6 @@
#!/bin/bash
/home/pi/bin/say_in_english "Hello, raspberry pi `hostname` is booting" || true
/home/pi/bin/say_in_english "IP is `hostname -I`" || true
exit 0

14
bin/_boot/notify_boot.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/sh
_IP=$(hostname -I) || true
_NAME=$(hostname) || true
_TMP=/tmp/Text.notify_boot.tmp
echo From: djocebot@gmail.com > $_TMP
echo To: jocelyn.fiat@gmail.com >> $_TMP
echo Subject: $_NAME ip=$_IP >> $_TMP
echo rpi ip=$_IP >> $_TMP
echo . >> $_TMP
curl -s -n --ssl-reqd --mail-from djocebot@gmail.com --mail-rcpt jocelyn.fiat@gmail.com --url smtps://smtp.gmail.com:465 -T $_TMP -u "djocebot@gmail.com:DjocBOT31"

View File

@@ -1,14 +0,0 @@
#!/bin/sh
_IP=$(hostname -I) || true
_NAME=$(hostname) || true
_TMP=/tmp/Text.notify_boot.tmp
echo From: djocebot@gmail.com > $_TMP
echo To: jocelyn.fiat@gmail.com >> $_TMP
echo Subject: $_NAME ip=$_IP >> $_TMP
echo rpi ip=$_IP >> $_TMP
echo . >> $_TMP
curl -s -n --ssl-reqd --mail-from djocebot@gmail.com --mail-rcpt jocelyn.fiat@gmail.com --url smtps://smtp.gmail.com:465 -T $_TMP -u "djocebot@gmail.com:DjocBOT31"

1
bin/notify_boot.sh Symbolic link
View File

@@ -0,0 +1 @@
_boot/notify_boot.sh

13
bin/on_boot Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
/home/pi/bin/_boot/notify_boot.sh || true
if [ "$1" != "" ]; then
echo Boot tests
else
/home/pi/bin/_boot/nas.sh || true
fi
/home/pi/bin/_boot/audio_boot_notication || true
exit 0

3
bin/say_in_english Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
say() { local IFS=+;/usr/bin/mplayer -ao alsa -really-quiet -noconsolecontrols "http://translate.google.com/translate_tts?tl=en&q=$*"; }
say $*

4
bin/say_in_french Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
say() { local IFS=+;/usr/bin/mplayer -ao alsa -really-quiet -noconsolecontrols "http://translate.google.com/translate_tts?tl=fr&q=$*"; }
#say() { local IFS=+;/usr/bin/mplayer -ao alsa -really-quiet -noconsolecontrols "http://translate.google.com/translate_tts?tl=en&q=$*"; }
say $*