From 3e8a824d89e5613c5a8d21f344aa2125bcf079ec Mon Sep 17 00:00:00 2001 From: poka Date: Fri, 20 Dec 2019 19:59:01 +0100 Subject: [PATCH] Fix debug/GSM_powerkey.sh do not stop key if is started. Replace by . Add .install/templates/2b/gammu-smsdrc --- .install/.GPATH | 1 + ...re_ipfs_layer.sh => 2a-configure_ipfs_layer.sh} | 2 +- .install/2b-configure_gammu.sh | 34 ++++++ .install/5-install_rompr.sh | 14 +++ .install/templates/.profile | 1 + .install/templates/{2 => 2a}/swarm.key | 0 .install/templates/2b/gammu-smsdrc | 26 +++++ .install/templates/5/youtube-dl.php | 128 +++++++++++++++++++++ .install/templates/init.sh | 10 +- GSM_POWERKEY.py | 10 -- _CopyLaRadio/copy.sh | 8 +- GSM_powerkey.sh => debug/GSM_powerkey.sh | 13 ++- debug/smsc.txt | 5 + install.sh | 15 ++- search | 4 +- shell/cron_MINUTE.sh | 8 +- shell/init.sh.old | 10 +- shell/init_keys.sh | 20 ++-- shell/sms_EMAIL.sh | 3 +- sms_received.sh | 10 +- www/rompr/REC/youtube-dl.php | 16 +-- 21 files changed, 289 insertions(+), 49 deletions(-) create mode 100644 .install/.GPATH rename .install/{2-configure_ipfs_layer.sh => 2a-configure_ipfs_layer.sh} (98%) create mode 100644 .install/2b-configure_gammu.sh create mode 100755 .install/5-install_rompr.sh rename .install/templates/{2 => 2a}/swarm.key (100%) create mode 100644 .install/templates/2b/gammu-smsdrc create mode 100644 .install/templates/5/youtube-dl.php delete mode 100755 GSM_POWERKEY.py rename GSM_powerkey.sh => debug/GSM_powerkey.sh (54%) create mode 100644 debug/smsc.txt diff --git a/.install/.GPATH b/.install/.GPATH new file mode 100644 index 0000000..ac91fa6 --- /dev/null +++ b/.install/.GPATH @@ -0,0 +1 @@ +GPATH=/home/pi/G1sms+ diff --git a/.install/2-configure_ipfs_layer.sh b/.install/2a-configure_ipfs_layer.sh similarity index 98% rename from .install/2-configure_ipfs_layer.sh rename to .install/2a-configure_ipfs_layer.sh index 0839556..162f6f6 100755 --- a/.install/2-configure_ipfs_layer.sh +++ b/.install/2a-configure_ipfs_layer.sh @@ -8,7 +8,7 @@ MY_PATH="`dirname \"$0\"`" # relative MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized stamp=$(date +%s) -templates="$MY_PATH/templates/2" +templates="$MY_PATH/templates/2a" ####################################### # CONFIGURE IPFS for G1sms+ Pi NODES diff --git a/.install/2b-configure_gammu.sh b/.install/2b-configure_gammu.sh new file mode 100644 index 0000000..4940c5c --- /dev/null +++ b/.install/2b-configure_gammu.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +MY_PATH="`dirname \"$0\"`" # relative +MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized +source $MY_PATH/../.install/.GPATH + +## Récupère les données du profile +[[ -f $MY_PATH/../.profile ]] && source $MY_PATH/../.profile + +## Désactive les processus écoutant le tty1 +[[ $(sudo systemctl status getty@tty1.service | grep "loaded") ]] && sudo systemctl stop getty@tty1.service && sudo systemctl disable getty@tty1.service + +## Copie et sed de /etc/gammu-smsdrc +[[ -f /etc/gammu-smsdrc ]] && sudo mv /etc/gammu-smsdrc /etc/gammu-smsdrc.old && echo "/etc/gammu-smsdrc a été renommé en /etc/gammu-smsdrc.old" +sudo cp $MY_PATH/templates/2b/gammu-smsdrc /etc/ + +GPATHS=$(echo $GPATH | sed 's./.\\/.g') +sudo sed -i "s/_GPATH/$GPATHS/g" /etc/gammu-smsdrc +sudo sed -i "s/_PIN/$PIN/g" /etc/gammu-smsdrc + +## Configure correctement le UART + +[[ ! $(grep enable_uart=1 /boot/config.txt) ]] && echo "enable_uart=1" | sudo tee -a /boot/config.txt +[[ $(grep "console=serial0" /boot/cmdline.txt) ]] && sudo sed -i "s/console=serial0,115200//g" /boot/cmdline.txt +[[ $(grep "console=serial0" /boot/cmdline.txt) ]] && echo -e "${c_red}Attention, console=serial0 est toujours présent dans /boot/cmdline.txt !$c_" && err=1 + +## Configure rc.local + + + +## Redémarre gammu-smsd +sudo service gammu-smsd restart && echo -e "${c_green}Gammu a été correctement configuré$c_" || echo -e "${c_green}Un problème est survenu lors de la configuration de gammu$c_" + +exit 0 diff --git a/.install/5-install_rompr.sh b/.install/5-install_rompr.sh new file mode 100755 index 0000000..987c507 --- /dev/null +++ b/.install/5-install_rompr.sh @@ -0,0 +1,14 @@ +#!/bin/bash +MY_PATH="`dirname \"$0\"`" # relative +MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized +source $MY_PATH/../.install/.GPATH + +GPATHS=$(echo $GPATH | sed 's./.\\/.g') + +sudo cp $MY_PATH/templates/5/youtube-dl.php $GPATH/www/rompr/REC/youtube-dl.php +sudo sed -i "s/_GPATH/$GPATHS/g" $GPATH/www/rompr/REC/youtube-dl.php + +## TODO +# Tout les reste ... + +exit 0 diff --git a/.install/templates/.profile b/.install/templates/.profile index d202a9a..c32b4b1 100644 --- a/.install/templates/.profile +++ b/.install/templates/.profile @@ -2,4 +2,5 @@ ADMINPSEUDO=_ADMINPSEUDO ADMINPHONE=_ADMINPHONE MASTERPHONE=_MASTERPHONE ADRESSE="_ADRESSE" +PIN=_PIN KSMS_DOMAIN= diff --git a/.install/templates/2/swarm.key b/.install/templates/2a/swarm.key similarity index 100% rename from .install/templates/2/swarm.key rename to .install/templates/2a/swarm.key diff --git a/.install/templates/2b/gammu-smsdrc b/.install/templates/2b/gammu-smsdrc new file mode 100644 index 0000000..77fbaad --- /dev/null +++ b/.install/templates/2b/gammu-smsdrc @@ -0,0 +1,26 @@ +# Configuration file for Gammu SMS Daemon + +[gammu] +port = /dev/ttyS0 +synchronizetime = yes +gammucoding = utf8 +connection = at +# Debugging +logformat = textall + +# SMSD configuration, see gammu-smsdrc(5) +[smsd] +service = files + +logfile = /var/log/gammu-smsd.log +PIN = _PIN + +# Paths where messages are stored (Not use if service = sql) +inboxpath = /var/spool/gammu/inbox/ +outboxpath = /var/spool/gammu/outbox/ +sentsmspath = /var/spool/gammu/sent/ +errorsmspath = /var/spool/gammu/error/ + +RunOnReceive = _GPATH/sms_received.sh +#IncludeSMSCFile = _GPATH/debug/smsc.txt +debuglevel = 3 diff --git a/.install/templates/5/youtube-dl.php b/.install/templates/5/youtube-dl.php new file mode 100644 index 0000000..efd05ca --- /dev/null +++ b/.install/templates/5/youtube-dl.php @@ -0,0 +1,128 @@ +[REC]'; + zcopylink += ' *'; + lines[0].text += zcopylink; +// ZEEBOX HACK ZONE +*/ +// RUN CLI if($argc>1) parse_str(implode('&',array_slice($argv, 1)), $_REQUEST); +$search=$radio=$artist=$title=$lnk=$lnkform=$cmd=$len=""; +$search = trim(urldecode($_REQUEST['q'])); + +$radio = urldecode($_REQUEST['radio']); +$artist = urldecode($_REQUEST['artist']); +$title = urldecode($_REQUEST['title']); +$lnk = trim(urldecode($_REQUEST['lnk'])); +$cmd="$radio|$artist|$title"; +$len=strlen($artist.$title); + +//$result='
'; +$result='
'; +if( $radio == "" ) { $radio = "CopyLaRadio"; } +if( $radio == "Nova zz" ) { + $artist = "undefined"; + $title = "undefined"; +} +// Write request for copy.sh triggering +if( $search == "REC" ) { +/////////////////// + $result.='

♫ '.$radio.' ♫

'; + // LINK RECEIVED + if ($lnk) { + $artist=""; + shell_exec('_GPATH/_CopyLaRadio/parle.sh "Lien reçu."'); + // Not making double request + if( ! exec('grep '.escapeshellarg($lnk).' /tmp/ytdl.list') ) { + file_put_contents("/tmp/ytdl.list","CopyLibre||$lnk\n", FILE_APPEND); + } + $result.='

LIEN: '.$lnk.'

'; +/////////////////// + // TRACK COPY (not for undefined or local file) + } else if ($radio && $artist != $title && $artist != "undefined" && $title != "undefined" && strlen(explode(".", $title)[1]) != 3 && explode(".", $title)[1] != "opus" ) { + // Not making double request + if( ! exec('grep '.escapeshellarg($cmd).' /tmp/ytdl.list') ) { + shell_exec('_GPATH/_CopyLaRadio/parle.sh "Enregistrement ajouté."'); + file_put_contents("/tmp/ytdl.list","$cmd\n", FILE_APPEND); + } else { + shell_exec('_GPATH/_CopyLaRadio/parle.sh "Copie déjà lancée"'); + } + $result.=' +

'.$artist.' / '.$title.'

+
'; +/////////////////// + // RADIO EXTERNAL TRACK SCRAPER + } else if($radio != "" && $artist == "undefined" && $title == "undefined" ){ + shell_exec('_GPATH/_CopyLaRadio/parle.sh "Recherche externe pour '.$radio.'"'); + file_put_contents("/tmp/youtube-dl.log", "_GPATH/_CopyLaRadio/libradio/".escapeshellcmd($radio).".php".PHP_EOL, FILE_APPEND); + if ( file_exists("_GPATH/_CopyLaRadio/libradio/".escapeshellcmd($radio).".php") ) { + file_put_contents("/tmp/ytdl.list","$radio||".PHP_EOL, FILE_APPEND); + } else { + shell_exec('_GPATH/_CopyLaRadio/parle.sh "Aucun module"'); + } + + } else { + shell_exec('_GPATH/_CopyLaRadio/parle.sh "Identification imprécise. Podcast? Fichier local?"'); + } + +} + +$ytform = '
+
+

ARTISTE:

+

TITRE:

+
+ + +
+ +
+'; + +$lnkform.='
+ +

youtube-dl

+- Sites compatibles - + + +

+
+ +
+
'; + +?> + + + + + + + + <?php echo $search;?> - Recherche YouTube & Copie privée + + + +
+
+
+
+
    + +
    +
+
    + +
    + +
    +
+ +
+
+
+
+ + diff --git a/.install/templates/init.sh b/.install/templates/init.sh index 672085c..7f5a01b 100755 --- a/.install/templates/init.sh +++ b/.install/templates/init.sh @@ -4,6 +4,11 @@ # Version: 0.1 # License: GPL (http://www.google.com/search?q=GPL) ################################################################## + +MY_PATH="`dirname \"$0\"`" # relative +MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized +source $MY_PATH/.install/.GPATH + # Adapter les valeurs au contexte spatio-temporel du NODE G1SMS function log () { # log ($1=text) @@ -31,8 +36,7 @@ fi export YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1); - export CHEMIN="/home/$YOU/G1sms+" - cd $CHEMIN + cd $GPATH ################################################################## # Activate logging to /tmp/g1sms.log (YES/NO) export DOLOG="YES" @@ -75,5 +79,5 @@ fi # TODO Use latest Silkaj from "sudo fredp3 install silkaj" # export SILKAJ="/usr/local/bin/silkaj" - source $CHEMIN/shell/init_keys.sh + source $GPATH/shell/init_keys.sh diff --git a/GSM_POWERKEY.py b/GSM_POWERKEY.py deleted file mode 100755 index 037387e..0000000 --- a/GSM_POWERKEY.py +++ /dev/null @@ -1,10 +0,0 @@ -import RPi.GPIO as GPIO -import time -GPIO.setmode(GPIO.BOARD) -GPIO.setup(7, GPIO.OUT) -while True: - GPIO.output(7, GPIO.LOW) - time.sleep(4) - GPIO.output(7, GPIO.HIGH) - break -GPIO.cleanup() diff --git a/_CopyLaRadio/copy.sh b/_CopyLaRadio/copy.sh index 8391a86..c94b441 100755 --- a/_CopyLaRadio/copy.sh +++ b/_CopyLaRadio/copy.sh @@ -1,5 +1,9 @@ #!/bin/bash +MY_PATH="`dirname \"$0\"`" # relative +MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized +source $MY_PATH/../.install/.GPATH + # Clean /tmp/ytdl.list #echo > /tmp/ytdl.list @@ -74,9 +78,9 @@ elif [[ "$radio" != "" && "$artist" == "" && "$song" == "" ]]; then # EXTERNAL PARSER: ADD SCRAPERS IN ./libradio ~/parle.sh "Recherche RADIO ${radio}" echo "External search: ${radio}" >> /tmp/youtube-dl.log 2>&1 - if [[ -f /home/pi/G1sms+/_CopyLaRadio/libradio/${radio}.php ]]; then + if [[ -f $GPATH/_CopyLaRadio/libradio/${radio}.php ]]; then ~/parle.sh "Module existant" - php "/home/pi/G1sms+/_CopyLaRadio/libradio/${radio}.php" + php "$GPATH/_CopyLaRadio/libradio/${radio}.php" else ~/parle.sh "Aucun module de décodage pour cette radio." fi diff --git a/GSM_powerkey.sh b/debug/GSM_powerkey.sh similarity index 54% rename from GSM_powerkey.sh rename to debug/GSM_powerkey.sh index 3615018..5526df2 100755 --- a/GSM_powerkey.sh +++ b/debug/GSM_powerkey.sh @@ -1,9 +1,16 @@ #!/bin/bash + +MY_PATH="`dirname \"$0\"`" +MY_PATH="`( cd \"$MY_PATH\" && pwd )`" + if [ ! -e /sys/class/gpio/gpio4 ]; then - echo "File exists." + echo "File doesn't exists." echo "4" > /sys/class/gpio/export fi + echo "out" > /sys/class/gpio/gpio4/direction -echo "0" > /sys/class/gpio/gpio4/value -sleep 2 echo "1" > /sys/class/gpio/gpio4/value + +sleep 3 && $MY_PATH/gammu-restart.sh + +exit 0 diff --git a/debug/smsc.txt b/debug/smsc.txt new file mode 100644 index 0000000..1dd1c98 --- /dev/null +++ b/debug/smsc.txt @@ -0,0 +1,5 @@ ++33695000695 ++33695000647 ++33695000646 ++33695000643 ++33695000636 diff --git a/install.sh b/install.sh index 0ecd354..e44d8bb 100755 --- a/install.sh +++ b/install.sh @@ -6,6 +6,10 @@ ################################################################################ MY_PATH="`dirname \"$0\"`" # relative MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized + +echo "GPATH=$MY_PATH" > $MY_PATH/.install/.GPATH +source $MY_PATH/.install/.GPATH + init_loc="$MY_PATH/shell/init.sh" now=$(date +%Y-%m-%d) unset err @@ -47,7 +51,7 @@ $MY_PATH/.install/export_colors.sh if [[ $force_req == "o" || -z $(which ipfs) || -z $(which gammu) ]];then echo -e "${c_yellow}IPFS ou gammu n'ont pas été détectés sur votre machine, nous allons installer tous les prérequis...$c_" $MY_PATH/.install/1-install_requirements.sh silkaj ipfs gammu || err+=1 - $MY_PATH/.install/2-configure_ipfs_layer.sh || err+=1 + $MY_PATH/.install/2a-configure_ipfs_layer.sh || err+=1 else echo -e "${c_green}IPFS et gammu sont déjà installé !$c_" fi @@ -66,7 +70,10 @@ if [[ -f $MY_PATH/.install/templates/init.sh ]]; then [[ ! $ADRESSE ]] && echo -e "${c_light}L'adresse où se trouve votre G1Node pour indiquer où venir chercher ses G1Tag (ex: au G1FabLab de Toulouse)$c_" && read ADRESSE - echo -e "ADMINPSEUDO: $ADMINPSEUDO\nADMINPHONE: $ADMINPHONE\nMASTERPHONE: $MASTERPHONE\nADRESSE: $ADRESSE" + [[ ! $PIN ]] && echo -e "${c_light}Le code PIN de votre carte SIM ? (ex: 1234)$c_" && read PIN + [[ "$PIN" == "" ]] && PIN="1234" + + echo -e "ADMINPSEUDO: $ADMINPSEUDO\nADMINPHONE: $ADMINPHONE\nMASTERPHONE: $MASTERPHONE\nADRESSE: $ADRESSE\nPIN: $PIN" [[ $noask != "o" ]] && echo -e "${c_light}${c_blue}LES PARAMETRES SONT BONS? Appliquer? ENTER ou CTRL-C ? (Editez le fichier .profile si incorrect)$c_" && read [[ -f shell/init.sh ]] && mv shell/init.sh shell/init.sh.old @@ -83,6 +90,7 @@ if [[ -f $MY_PATH/.install/templates/init.sh ]]; then sed -i s/_ADRESSE/$ADRESSE/g $MY_PATH/.profile sed -i s/_ADMINPHONE/$ADMINPHONE/g $MY_PATH/.profile sed -i s/_ADMINPSEUDO/$ADMINPSEUDO/g $MY_PATH/.profile + sed -i s/_PIN/$PIN/g $MY_PATH/.profile fi else @@ -91,6 +99,9 @@ else exit 1 fi +## Configuration de gammu +$MY_PATH/.install/2b-configure_gammu.sh || err=1 + ## Installations optionnels repOld=$repOption diff --git a/search b/search index b2c0947..f5b8195 100755 --- a/search +++ b/search @@ -2,7 +2,7 @@ clear echo "------------------------------------------------------------------------------" if [ "$1" == "" ]; then - echo " Nothing to search for!" + echo " Nothing to search for!" else echo " Searching for "$1" recursively. Please Wait..." echo "------------------------------------------------------------------------------" @@ -10,7 +10,7 @@ else fi echo "------------------------------------------------------------------------------" if [ "$2" != "" ]; then - echo " To replace \"$1\" whith \"$2\", please run" + echo " To replace \"$1\" whith \"$2\", please run" echo " grep -rl '$1' ./ | xargs sed -i 's/$1/$2/g'" fi diff --git a/shell/cron_MINUTE.sh b/shell/cron_MINUTE.sh index 483b68f..9e6c50f 100755 --- a/shell/cron_MINUTE.sh +++ b/shell/cron_MINUTE.sh @@ -7,10 +7,14 @@ # CE FICHIER cron_MINUTE.sh EST EXECUTE TOUTES LES MINUTES # IL CONSTITUE LE BATEMENT DE COEUR DU SYSTEME ################################################################################ + +MY_PATH="`dirname \"$0\"`" # relative +MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized +source $MY_PATH/../.install/.GPATH + YOU=$(ps aux --sort=+utime | grep ipfs | tail -n 1 | cut -d " " -f 1) IPFSNODEID=$(su $YOU -c "ipfs id -f='\n'") -CHEMIN="/home/$YOU/G1sms+" -cd $CHEMIN +cd $GPATH source ./shell/init.sh source ./shell/functions.sh diff --git a/shell/init.sh.old b/shell/init.sh.old index 65517c1..7a2984a 100755 --- a/shell/init.sh.old +++ b/shell/init.sh.old @@ -5,6 +5,11 @@ # License: GPL (http://www.google.com/search?q=GPL) ################################################################## # Adapter les valeurs au contexte spatio-temporel du NODE G1SMS + +MY_PATH="`dirname \"$0\"`" # relative +MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized +source $MY_PATH/../.install/.GPATH + function log () { # log ($1=text) if [ "$DOLOG" == "YES" ] @@ -31,8 +36,7 @@ fi export YOU=$(ps aux --sort=+utime | grep ipfs | tail -n 1 | cut -d " " -f 1) - export CHEMIN="/home/$YOU/G1sms+" - cd $CHEMIN + cd $GPATH ################################################################## # Activate logging to /tmp/g1sms.log (YES/NO) export DOLOG="YES" @@ -75,5 +79,5 @@ fi # TODO Use latest Silkaj from "sudo fredp3 install silkaj" # export SILKAJ="/usr/local/bin/silkaj" - source $CHEMIN/shell/init_keys.sh + source $GPATH/shell/init_keys.sh diff --git a/shell/init_keys.sh b/shell/init_keys.sh index 67210aa..eb495a9 100755 --- a/shell/init_keys.sh +++ b/shell/init_keys.sh @@ -6,9 +6,13 @@ ################################################################## # CHECK & WARN | CREATE Keys (gpg encrypt, G1wallet, IPNS publish) ################################################################## + +MY_PATH="`dirname \"$0\"`" # relative +MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized +source $MY_PATH/.install/.GPATH + YOU=$(ps aux --sort=+utime | grep ipfs | tail -n 1 | cut -d " " -f 1) # TODO Make it directory independant. (for now it is tested for pi running ipfs and code in $HOME/G1sms+ -CHEMIN="/home/$YOU/G1sms+" ################################################################## # G1sms+ Node KEYS (G1wallet, gpg, IPNS) @@ -20,17 +24,17 @@ if [ ! $GPGPASS ]; then echo "FATAL ERROR:: IPFS Node.Identity.PrivKey GPGPASS E # G1sms+ Swarm KEYS ################################################################## # G1sms Service - G1Wallet -if [[ -f "${CHEMIN}/g1sms.pub.key" && -f "${CHEMIN}/g1sms.priv.key" ]]; then - chown root:root ${CHEMIN}/g1sms.priv.key - chmod 600 ${CHEMIN}/g1sms.priv.key - export MASTERPUB=$(cat "${CHEMIN}/g1sms.pub.key") - export MASTERKEYFILE="${CHEMIN}/g1sms.priv.key" +if [[ -f "${GPATH}/g1sms.pub.key" && -f "${GPATH}/g1sms.priv.key" ]]; then + chown root:root ${GPATH}/g1sms.priv.key + chmod 600 ${GPATH}/g1sms.priv.key + export MASTERPUB=$(cat "${GPATH}/g1sms.pub.key") + export MASTERKEYFILE="${GPATH}/g1sms.priv.key" else echo "ATTENTION!! Vous devez posséder la clef du G1 Wallet utilisé par le SWARM G1sms!!" ./shell/parle.sh "Les clefs du portefeuille essaim G1 SMS sont absente. Au revoir." echo "Fichiers manquants:" - echo "${CHEMIN}/g1sms.pub.key" - echo "${CHEMIN}/g1sms.priv.key" + echo "${GPATH}/g1sms.pub.key" + echo "${GPATH}/g1sms.priv.key" echo "Contactez nous sur https://g1sms.fr" gammu-smsd-inject -l TEXT "$ADMINPHONE" -text "Clef de G1Wallet du SWARM g1sms.priv.key manquante! contactez-nous pour la recevoir https://g1sms.fr" 1>&2 exit diff --git a/shell/sms_EMAIL.sh b/shell/sms_EMAIL.sh index 2ebba7b..14d901a 100755 --- a/shell/sms_EMAIL.sh +++ b/shell/sms_EMAIL.sh @@ -7,9 +7,10 @@ # sudo apt install ssmtp mpack # Configure in /etc/ssmtp # Send email with file attachement: mpack -s "Logo G1Tag" /home/pi/G1sms+/G1Tag.png dest@email.ext - + source ./shell/init.sh source ./shell/functions.sh + log "__SUB:sms_EMAIL.sh.sh: START ($1=phone, $2=mail)" phone="$1" diff --git a/sms_received.sh b/sms_received.sh index 4bf00d5..c6d1f93 100755 --- a/sms_received.sh +++ b/sms_received.sh @@ -27,14 +27,16 @@ # License: GPL (http://www.google.com/search?q=GPL) ################################################################################ +MY_PATH="`dirname \"$0\"`" # relative +MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized + # Execute Kalkun daemon [[ -f /var/www/kalkun/scripts/daemon.sh ]] && /var/www/kalkun/scripts/daemon.sh export YOU=$(ps aux --sort=+utime | grep ipfs | tail -n 1 | cut -d " " -f 1) -export CHEMIN="/home/$YOU/G1sms+" -cd $CHEMIN -source ./shell/init.sh -source ./shell/functions.sh +cd $GPATH +source $MY_PATH/shell/init.sh +source $MY_PATH/shell/functions.sh ################################################################## # Get global variables from gammu-smsd diff --git a/www/rompr/REC/youtube-dl.php b/www/rompr/REC/youtube-dl.php index 26e2eda..ad1d71d 100644 --- a/www/rompr/REC/youtube-dl.php +++ b/www/rompr/REC/youtube-dl.php @@ -1,11 +1,11 @@ [REC]'; +// ZEEBOX HACK ZONE + var reclink = '/REC/youtube-dl.php?q=REC&artist=' + escape(encodeURIComponent(npinfo.Artist)) + '&title=' + escape(encodeURIComponent(npinfo.Title)) + '&radio='+ escape(encodeURIComponent(npinfo.stream)) +'&maxResults=1'; + var zcopylink = ' [REC]'; zcopylink += ' *'; - lines[0].text += zcopylink; + lines[0].text += zcopylink; // ZEEBOX HACK ZONE */ // RUN CLI if($argc>1) parse_str(implode('&',array_slice($argv, 1)), $_REQUEST); @@ -22,7 +22,7 @@ $len=strlen($artist.$title); //$result='
'; $result='
'; if( $radio == "" ) { $radio = "CopyLaRadio"; } -if( $radio == "Nova zz" ) { +if( $radio == "Nova zz" ) { $artist = "undefined"; $title = "undefined"; } @@ -62,7 +62,7 @@ if( $search == "REC" ) { } else { shell_exec('/home/pi/G1sms+/_CopyLaRadio/parle.sh "Aucun module"'); } - + } else { shell_exec('/home/pi/G1sms+/_CopyLaRadio/parle.sh "Identification imprécise. Podcast? Fichier local?"'); } @@ -116,10 +116,10 @@ $lnkform.='

    - +
- +