V0.1 beta
This commit is contained in:
parent
e53d7fbf29
commit
621fc0390f
10
biosms.sh
10
biosms.sh
|
@ -11,5 +11,13 @@ ME="${0##*/}"
|
|||
echo "EXECUTE $ME ($1, $2)"
|
||||
echo "Expédition SMS aux GROUPES et PHONE"
|
||||
|
||||
# SEARCH FOR /home/${YOU}/.zen/SMS/PHONE/${phonehash}/${ts}.tosend.sh
|
||||
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) || er+=" ipfs daemon not running"
|
||||
[[ ! -f /home/${YOU}/.zen/secret.dunikey ]] && echo "Crypto is missing... please provide /home/${YOU}/.zen/secret.dunikey by installing 'astrXbian' TestNet" && exit 1
|
||||
G1PUB=$(cat /home/${YOU}/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
|
||||
|
||||
# SEARCH FOR /home/${YOU}/.zen/SMS/PHONE/${phonehash}/${ts}.tosend.sh
|
||||
./scraper2sms.sh
|
||||
|
||||
BIODYNSMS=$(cat /tmp/sms)
|
||||
# for ls ~/.zen/SMS/GUILDES/MIZ/MEMBERS/*
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ YEAR=$(date +%y)
|
|||
[[ $DAY == "Sunday" ]] && DAY="Dimanche" && DAYE="Mardi"
|
||||
|
||||
# CHECK WEEK INTERVAL
|
||||
S=1
|
||||
[[ $DOM -ge $A && $DOM -le $B ]] && S=1
|
||||
[[ $DOM -ge $C && $DOM -le $D ]] && S=2
|
||||
|
|
@ -22,7 +22,7 @@ G1PUB=$(cat /home/${YOU}/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
|
|||
## TEST PHONE
|
||||
########################################################################
|
||||
phonehash=$(echo $phone | sha256sum | cut -d ' ' -f1)
|
||||
htest=$(ls /home/${YOU}/.zen/SMS/PHONE/${phonehash} 2>dev/null)
|
||||
htest=$(ls /home/${YOU}/.zen/SMS/PHONE/${phonehash} 2>/dev/null)
|
||||
if [[ $htest ]]; then
|
||||
NEW=0
|
||||
xzuid=$(cat "/home/${YOU}/.zen/SMS/PHONE/${phonehash}/xzuid.txt")
|
||||
|
@ -52,9 +52,11 @@ $MY_PATH/natools.py decrypt -f pubsec -k "/home/${YOU}/.zen/secret.dunikey" -i "
|
|||
########################################################################
|
||||
if [[ "${guilde}" == "MIZ" ]]; then
|
||||
|
||||
if [[ -f /var/www/nextcloud/occ ]]; then
|
||||
echo "## DELETE NEXTCLOUD : $xzuid"
|
||||
sudo su -s /bin/sh www-data -c "export OC_PASS=\"$phone\" && php /var/www/nextcloud/occ user:delete $xzuid"
|
||||
[[ ! $? == 0 ]] && echo "FAILED" && exit 1
|
||||
fi
|
||||
|
||||
echo "## DELETE GCHANGE : $xzuid"
|
||||
$MY_PATH/jaklis/jaklis.py -k /home/${YOU}/.zen/SMS/DUNIKEY/${xzuid}_${phone}.dunikey -n "https://data.gchange.fr" erase
|
||||
|
@ -70,9 +72,11 @@ fi
|
|||
|
||||
########################################################################
|
||||
if [[ "${guilde}" == "NEXTCLOUD" ]]; then
|
||||
if [[ -f /var/www/nextcloud/occ ]]; then
|
||||
sudo su -s /bin/sh www-data -c "export OC_PASS=\"$phone\" && php /var/www/nextcloud/occ user:delete $xzuid"
|
||||
[[ ! $? == 0 ]] && echo "FAILED" && exit 1
|
||||
fi
|
||||
fi
|
||||
########################################################################
|
||||
|
||||
########################################################################
|
||||
|
|
|
@ -32,7 +32,7 @@ phonehash=$(echo $phone | sha256sum | cut -d ' ' -f1)
|
|||
echo "=> ${phonehash}"
|
||||
########################################################################
|
||||
|
||||
htest=$(ls /home/${YOU}/.zen/SMS/PHONE/${phonehash} 2>dev/null)
|
||||
htest=$(ls /home/${YOU}/.zen/SMS/PHONE/${phonehash} 2>/dev/null)
|
||||
if [[ $htest ]]; then
|
||||
NEW=0
|
||||
xzuid=$(cat "/home/${YOU}/.zen/SMS/PHONE/${phonehash}/xzuid.txt")
|
||||
|
@ -62,7 +62,7 @@ if [[ ! $xzuid ]]; then
|
|||
echo "## $xzuid / $phone => NEW DUNIKEY & QRCODE"
|
||||
########################################################################
|
||||
echo "#!/bin/bash
|
||||
sudo gammu sendsms TEXT \"$phone\" -text \"Bienvenue dans le JEu 'Made In Zion / Astroport' - $xzuid est votre Identité Interplanétaire, heureux de vous compter parmi nous \"" > /home/${YOU}/.zen/SMS/PHONE/${phonehash}/$(date -u +%s%N | cut -b1-13).tosend.sh
|
||||
sudo gammu sendsms TEXT \"$phone\" -text \"Heureux de vous accueillir. $xzuid est votre nouvelle Identité Interplanétaire MadeInZion/Astroport.\"" > /home/${YOU}/.zen/SMS/PHONE/${phonehash}/$(date -u +%s%N | cut -b1-13).tosend.sh
|
||||
|
||||
########################################################################
|
||||
echo "## MAKE secret.dunikey"
|
||||
|
@ -102,7 +102,7 @@ sudo gammu sendsms TEXT \"$phone\" -text \"Votre identifiant est $xzuid, votre m
|
|||
########################################################################
|
||||
$MY_PATH/timeout.sh -t 10 curl -s https://thispersondoesnotexist.com/image -o /home/${YOU}/.zen/SMS/PHONE/${phonehash}/avatar.jpg
|
||||
[[ $? == 0 ]] && echo "#!/bin/bash
|
||||
sudo gammu sendsms TEXT \"$phone\" -text \"Notre Intelligence Artificielle Amie vient de créer la photo de profil anonyme de votre avatar ${xzuid}\"" > /home/${YOU}/.zen/SMS/PHONE/${phonehash}/$(date -u +%s%N | cut -b1-13).tosend.sh
|
||||
sudo gammu sendsms TEXT \"$phone\" -text \"Nous venons de créer une photo de profil anonyme pour votre avatar ${xzuid}/${phone}\"" > /home/${YOU}/.zen/SMS/PHONE/${phonehash}/$(date -u +%s%N | cut -b1-13).tosend.sh
|
||||
|
||||
if [[ -f /home/${YOU}/.zen/SMS/PHONE/${phonehash}/avatar.jpg ]]; then
|
||||
########################################################################
|
||||
|
@ -110,14 +110,14 @@ sudo gammu sendsms TEXT \"$phone\" -text \"Notre Intelligence Artificielle Amie
|
|||
########################################################################
|
||||
$MY_PATH/timeout.sh -t 10 $MY_PATH/jaklis/jaklis.py -k /tmp/secret.dunikey -n "https://data.gchange.fr" set --name "${xzuid}" --avatar "/home/${YOU}/.zen/SMS/PHONE/${phonehash}/avatar.jpg" #GCHANGE+
|
||||
[[ $? == 0 ]] && echo "#!/bin/bash
|
||||
sudo gammu sendsms TEXT \"$phone\" -text \"Avec https://gchange.fr quittez la monnaie des Banques et échangez gratuitement en JUNE : https://monnaie-libre.fr \"" > /home/${YOU}/.zen/SMS/PHONE/${phonehash}/$(date -u +%s%N | cut -b1-13).tosend.sh
|
||||
sudo gammu sendsms TEXT \"$phone\" -text \"Utilisez https://gchange.fr quittez la monnaie des Banques et échangez gratuitement en JUNE : https://monnaie-libre.fr \"" > /home/${YOU}/.zen/SMS/PHONE/${phonehash}/$(date -u +%s%N | cut -b1-13).tosend.sh
|
||||
|
||||
########################################################################
|
||||
echo "CESIUM+ PROFILE"
|
||||
########################################################################
|
||||
$MY_PATH/timeout.sh -t 10 $MY_PATH/jaklis/jaklis.py -k /tmp/secret.dunikey -n "https://g1.data.e-is.pro" set --name "${xzuid}" --avatar "/home/${YOU}/.zen/SMS/PHONE/${phonehash}/avatar.jpg" #CESIUM+
|
||||
[[ $? == 0 ]] && echo "#!/bin/bash
|
||||
sudo gammu sendsms TEXT \"$phone\" -text \"Recevez vos primes de missions sur votre portefeuille libre https://cesium.app - $g1pub -\"" > /home/${YOU}/.zen/SMS/PHONE/${phonehash}/$(date -u +%s%N | cut -b1-13).tosend.sh
|
||||
sudo gammu sendsms TEXT \"$phone\" -text \"Recevez les primes de vos missions sur votre portefeuille libre https://cesium.app - $g1pub -\"" > /home/${YOU}/.zen/SMS/PHONE/${phonehash}/$(date -u +%s%N | cut -b1-13).tosend.sh
|
||||
|
||||
fi
|
||||
|
||||
|
@ -127,7 +127,7 @@ sudo gammu sendsms TEXT \"$phone\" -text \"Recevez vos primes de missions sur vo
|
|||
########################################################################
|
||||
sudo su -s /bin/sh www-data -c "export OC_PASS=\"${phone}\" && php /var/www/nextcloud/occ user:add --password-from-env --group=\"${guilde}\" --display-name=\"${xzuid}\" ${xzuid}"
|
||||
[[ $? == 0 ]] && echo "#!/bin/bash
|
||||
sudo gammu sendsms TEXT \"$phone\" -text \"Fuyez les GAFAM! Synchronisez votre smartphone sur NEXTCloud chez un ami du réseau de %MAKER https://copylaradio.com - DEMO - https://taurus.copylaradio.com\"" > /home/${YOU}/.zen/SMS/PHONE/${phonehash}/$(date -u +%s%N | cut -b1-13).tosend.sh
|
||||
sudo gammu sendsms TEXT \"$phone\" -text \"Quittez les GAFAM! Synchronisez votre smartphone avec NEXTCloud chez un ami du réseau de %MAKER https://copylaradio.com - DEMO - https://taurus.copylaradio.com\"" > /home/${YOU}/.zen/SMS/PHONE/${phonehash}/$(date -u +%s%N | cut -b1-13).tosend.sh
|
||||
|
||||
fi
|
||||
|
||||
|
@ -155,7 +155,7 @@ echo "## GESTION RELATION PHONE / GUILDE : ${phone} / ${guilde}"
|
|||
########################################################################
|
||||
## NOUVELLE INSCRIPTION
|
||||
[[ ! -f /home/${YOU}/.zen/SMS/GUILDES/${guilde}/INPUT/${phone} ]] && echo "#!/bin/bash
|
||||
sudo gammu sendsms TEXT \"$phone\" -text \"Faisons connaissance. Ouvrez votre compte sur https://oasis.astroport.com -SVP- Utilisez votre Prénom Nom -SVP- \"" > /home/${YOU}/.zen/SMS/PHONE/${phonehash}/0000000000000.tosend.sh
|
||||
sudo gammu sendsms TEXT \"$phone\" -text \"Bienvenue ${xzuid}. Continuez votre inscription au JEu avec votre actuelle identité 'Prénom Nom' sur https://oasis.astroport.com\"" > /home/${YOU}/.zen/SMS/PHONE/${phonehash}/0000000000000.tosend.sh
|
||||
|
||||
## MEMORISATION DU MESSAGE dans GUILDES/${guilde}/INPUT/
|
||||
mkdir -p /home/${YOU}/.zen/SMS/GUILDES/${guilde}/INPUT/
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -3,7 +3,7 @@
|
|||
phone="$1"
|
||||
phonehash=$(echo $phone | sha256sum | cut -d ' ' -f1)
|
||||
message="$2"
|
||||
groupe="$3"
|
||||
# groupe="$3"
|
||||
|
||||
ts=$(date -u +%s%N | cut -b1-13)
|
||||
echo "#!/bin/bash
|
||||
|
|
|
@ -10,12 +10,15 @@ prefix="+33"
|
|||
MY_PATH="`dirname \"$0\"`" # relative
|
||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||
########################################################################
|
||||
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) || er+=" ipfs daemon not running"
|
||||
[[ ! -f /home/${YOU}/.zen/secret.dunikey ]] && echo "Crypto is missing... please provide /home/${YOU}/.zen/secret.dunikey by installing 'astrXbian' TestNet" && exit 1
|
||||
G1PUB=$(cat /home/${YOU}/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
|
||||
|
||||
########################################################################
|
||||
# GET smsadmin PHONE NUMBER FROM ~/.zen/SMSADMIN FILE
|
||||
########################################################################
|
||||
[[ ! -f /home/pi/.zen/SMSADMIN ]] && echo "EXIT. Indiquez votre numéro de mobile dans /home/pi/.zen/SMSADMIN" && exit 1
|
||||
SMSADMIN="$(cat /home/pi/.zen/SMSADMIN)" ## FRENCH NUMBER
|
||||
[[ ! -f /home/${YOU}/.zen/SMSADMIN ]] && echo "EXIT. Indiquez votre numéro de mobile dans /home/${YOU}/.zen/SMSADMIN" && exit 1
|
||||
SMSADMIN="$(cat /home/${YOU}/.zen/SMSADMIN)" ## FRENCH NUMBER
|
||||
[[ ${SMSADMIN#"$prefix"} != "${SMSADMIN}" ]] && smsadmin=0${SMSADMIN#"$prefix"} || smsadmin="${SMSADMIN}" ## 06
|
||||
|
||||
########################################################################
|
||||
|
@ -33,7 +36,7 @@ ping -q -w 1 -c 1 taurus.copylaradio.com 2>&1>/dev/null && echo "TAURUS OK" && T
|
|||
PHONE="$SMS_1_NUMBER" # gammu-smsd
|
||||
[[ ! ${PHONE} ]] && PHONE="$1" # CLI MODE
|
||||
|
||||
[[ "${#PHONE}" < 10 || "${#PHONE}" > 12 ]] && echo "${PHONE} NON RECONNU. EXIT" && exit 1
|
||||
[[ "${#PHONE}" < 10 || "${#PHONE}" > 12 ]] && echo "PHONE ${PHONE} NON RECONNU. EXIT" && exit 1
|
||||
## Remove prefix: phone contains local number
|
||||
[[ ${PHONE#"$prefix"} != "${PHONE}" ]] && phone=0${PHONE#"$prefix"} || phone="${PHONE}"
|
||||
|
||||
|
@ -78,7 +81,8 @@ case "$CMD" in
|
|||
|
||||
STOP)
|
||||
## STOP RELATION WITH CMD GUILDE GROUP
|
||||
$MY_PATH/sms/ERASE.sh "$phone" "$CMD" &
|
||||
GUILDE=$(echo "$TEXT" | awk '{print toupper($2)}')
|
||||
$MY_PATH/sms/ERASE.sh "$phone" "$GUILDE" &
|
||||
;;
|
||||
|
||||
*)
|
||||
|
@ -89,7 +93,7 @@ case "$CMD" in
|
|||
echo "${MESSAGE}"
|
||||
fi
|
||||
## OK CMD=GROUPE suivi de message
|
||||
$MY_PATH/sms/GUILDE.sh "$phone" "$CMD" > /home/pi/.zen/SMS/debug.log
|
||||
$MY_PATH/sms/GUILDE.sh "$phone" "$CMD" > /home/${YOU}/.zen/SMS/debug.log
|
||||
|
||||
## TRY UGGLY WAY !!??
|
||||
# sudo service gammu-smsd stop
|
||||
|
@ -102,5 +106,5 @@ esac
|
|||
## [[ "$phone" != "$smsadmin" ]] && gammu-smsd-inject TEXT "$smsadmin" -text "$phone : $TEXT"
|
||||
|
||||
## FILESYSTEM RIGHTS CORRECTION
|
||||
chown -R pi:pi /home/pi/.zen/SMS
|
||||
chown -R ${YOU}:${YOU} /home/${YOU}/.zen/SMS
|
||||
exit 0
|
||||
|
|
Loading…
Reference in New Issue