protect from bad parameters
This commit is contained in:
parent
1e3e1fe0b5
commit
e24b4ed75e
@ -17,12 +17,14 @@ G1PUB=$(cat /home/${YOU}/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
|
||||
GUILDE="$1"
|
||||
|
||||
# PROCESS /tmp/sms to GUILDE cut in piece SMS
|
||||
[[ "$1" == "" ]] && ${MY_PATH}/scrapers/org.bio-dynamie.sh && GUILDE="BIODYN" ## DEFAULT GUILDE BIODYN
|
||||
[[ "$1" == "" ]] && ${MY_PATH}/../scrapers/org.bio-dynamie.sh && GUILDE="BIODYN" ## DEFAULT GUILDE BIODYN
|
||||
if [[ $? != 0 ]]; then
|
||||
echo "SITE INACCESSIBLE ?"
|
||||
echo "#!/bin/bash
|
||||
sudo gammu sendsms TEXT \"_PHONE_\" -text \"Site Web https://bio-dynamie.org inaccessible ce matin \"" > /home/${YOU}/.zen/SMS/GUILDES/${GUILDE}/OUTPUT/$(date -u +%s%N | cut -b1-13).tosend.sh
|
||||
fi
|
||||
|
||||
[[ ${GUILDE} == "" || ! -d /home/${YOU}/.zen/SMS/GUILDES/${GUILDE} ]] && echo "AUCUNE GUILDE. EXIT." && exit 1
|
||||
[[ ! -d /home/${YOU}/.zen/SMS/GUILDES/${GUILDE}/OUTPUT/ ]] && mkdir -p /home/${YOU}/.zen/SMS/GUILDES/${GUILDE}/OUTPUT/
|
||||
|
||||
## PREPARE SMS OUTPUT FOR ${GUILDE} GUILDE
|
||||
@ -39,3 +41,4 @@ done
|
||||
|
||||
chmod +x /home/${YOU}/.zen/SMS/GUILDES/${GUILDE}/OUTPUT/*.tosend.sh
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user