2021-06-08 16:16:09 +02:00
|
|
|
#!/bin/bash
|
|
|
|
################################################################################
|
|
|
|
# Author: Fred (support@qo-op.com)
|
|
|
|
# Version: 0.1
|
|
|
|
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
|
|
|
|
################################################################################
|
2021-07-06 18:42:44 +02:00
|
|
|
echo "AIDE pour ($1=phone)"
|
2021-06-09 03:54:30 +02:00
|
|
|
phone="$1"
|
2021-07-06 18:42:44 +02:00
|
|
|
phonehash=$(echo $phone | sha256sum | cut -d ' ' -f1)
|
2021-07-08 05:25:41 +02:00
|
|
|
|
2021-07-08 06:23:58 +02:00
|
|
|
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) || echo "ipfs daemon not running"
|
2021-07-06 18:42:44 +02:00
|
|
|
SMSADMIN="$(cat /home/${YOU}/.zen/SMSADMIN)"
|
2021-06-21 18:43:23 +02:00
|
|
|
|
2021-07-08 06:21:51 +02:00
|
|
|
ls /home/${YOU}/.zen/SMS/PHONE/${phonehash}/GUILDES/
|
|
|
|
|
2021-07-08 01:31:27 +02:00
|
|
|
guilde=""
|
|
|
|
for guildes in /home/${YOU}/.zen/SMS/PHONE/${phonehash}/GUILDES/*; do
|
|
|
|
guilde="$(echo "$guildes" | cut -d '/' -f 9);$guilde"
|
|
|
|
done; echo "$guilde"
|
|
|
|
|
2021-07-08 06:25:29 +02:00
|
|
|
MESS="MadeInZion - Vos guildes : $guilde - Votre Guide : $SMSADMIN"
|
2021-06-21 18:43:23 +02:00
|
|
|
|
2021-07-06 18:42:44 +02:00
|
|
|
echo "#!/bin/bash
|
|
|
|
sudo gammu sendsms TEXT \"$phone\" -text \"$MESS\"" > /home/${YOU}/.zen/SMS/PHONE/${phonehash}/$(date -u +%s%N | cut -b1-13).tosend.sh
|
2021-06-08 16:16:09 +02:00
|
|
|
|
|
|
|
exit 0
|