GUIDE MONITORING

master
qo-op 2021-07-09 14:08:24 +02:00
parent 7b3196d5a3
commit 1e7f18d125
1 changed files with 15 additions and 4 deletions

View File

@ -104,19 +104,30 @@ case "$CMD" in
;;
esac
## FILESYSTEM RIGHTS CORRECTION
chown -R ${YOU}:${YOU} /home/${YOU}/.zen/SMS
## ADMIN MONITORING
## SEND A COPY OF INCOMING MESSAGE TO SMSADMIN
if [[ "$phone" != "$SMSADMIN" ]]; then
adminhash=$(echo $SMSADMIN | sha256sum | cut -d ' ' -f1)
phonehash=$(echo $phone | sha256sum | cut -d ' ' -f1)
ID=$(cat /home/${YOU}/.zen/SMS/PHONE/${phonehash}/xzuid.txt 2>/dev/null)
echo "#!/bin/bash
sudo gammu sendsms TEXT \"_PHONE_\" -text \"> - $phone - $ID - $TEXT\"" > /home/${YOU}/.zen/SMS/PHONE/${adminhash}/$(date -u +%s%N | cut -b1-13).tosend.sh
sudo gammu sendsms TEXT \"_PHONE_\" -text \">> $phone|$ID $TEXT\"" > /home/${YOU}/.zen/SMS/PHONE/${adminhash}/$(date -u +%s%N | cut -b1-13).tosend.sh
chmod +x /home/${YOU}/.zen/SMS/PHONE/${adminhash}/*.tosend.sh
## ADD TO GUILDE GUIDE ROOTING : TODO
## ADD TO GUILDE GUIDE ROOTING
# /home/${YOU}/.zen/SMS/GUILDES/${guilde}/INPUT/$(SCORE)_${phone}_guide.txt
IsThereAGuide=$(ls /home/${YOU}/.zen/SMS/GUILDES/${CMD}/INPUT/*_guide.txt | head -n 1 2>/dev/null)
[[ $IsThereAGuide ]] && guidephone=$(echo $IsThereAGuide | cut -d '/' -f 9 | cut -f '_' -f 2) || echo "NO GUIDE" && exit 0
guidescore=$(echo $IsThereAGuide | cut -d '/' -f 9 | cut -f '_' -f 1)
guidephonehash=$(echo $guidephone | sha256sum | cut -d ' ' -f1)
echo "#!/bin/bash
sudo gammu sendsms TEXT \"_PHONE_\" -text \">> $phone|$ID $TEXT\"" > /home/${YOU}/.zen/SMS/PHONE/${guidephonehash}/$(date -u +%s%N | cut -b1-13).tosend.sh
chmod +x /home/${YOU}/.zen/SMS/PHONE/${guidephonehash}/*.tosend.sh
fi
## FILESYSTEM RIGHTS CORRECTION
chown -R ${YOU}:${YOU} /home/${YOU}/.zen/SMS
exit 0