27 lines
1019 B
Bash
Executable File
27 lines
1019 B
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/)
|
|
################################################################################
|
|
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" && exit 1
|
|
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"
|
|
|
|
MESS="MadeInZion - Vos guildes : $guilde - 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
|