35 lines
1.4 KiB
Bash
Executable File
35 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
################################################################################
|
|
# Author: Fred (support@qo-op.com)
|
|
# Version: 0.1
|
|
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
|
|
################################################################################
|
|
MY_PATH="`dirname \"$0\"`" # relative
|
|
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
|
cd $MY_PATH
|
|
|
|
echo "AIDE pour ($1=phone)"
|
|
phone="$1"
|
|
phonehash=$(echo $phone | sha256sum | cut -d ' ' -f1)
|
|
|
|
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"
|
|
SMSADMIN="$(cat /home/${YOU}/.zen/SMSADMIN)"
|
|
|
|
ls /home/${YOU}/.zen/SMS/PHONE/${phonehash}/GUILDES/
|
|
|
|
guilde=""
|
|
for guildes in /home/${YOU}/.zen/SMS/PHONE/${phonehash}/GUILDES/*; do
|
|
guilde="$(echo "$guildes" | cut -d '/' -f 9);$guilde"
|
|
done; echo "$guilde"
|
|
|
|
XZUID=$(cat /home/${YOU}/.zen/SMS/PHONE/${phonehash}/xzuid.txt)
|
|
$MY_PATH/natools.py decrypt -f pubsec -k "/home/${YOU}/.zen/secret.dunikey" -i "/home/${YOU}/.zen/SMS/PHONE/${phonehash}/pin.encrypt" -o "/tmp/${phonehash}.pin"
|
|
PASS=$(cat /tmp/${phonehash}.pin) && rm /tmp/${phonehash}.pin
|
|
|
|
MESS="MadeInZion - $XZUID ($PASS) - Vos guildes : $guilde - Votre Guide : $SMSADMIN"
|
|
|
|
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
|
|
|
|
exit 0
|