Astroport.ONE/20h12.process.sh

60 lines
1.9 KiB
Bash
Raw Normal View History

#!/bin/bash
########################################################################
# Version: 0.3
# 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
ME="${0##*/}"
2022-09-12 11:36:39 +02:00
start=`date +%s`
echo "20H12 (♥‿‿♥) $(hostname)"
myIP=$(hostname -I | awk '{print $1}' | head -n 1)
[[ ! $myIP ]] && myIP="127.0.1.1"
isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/")
2022-10-21 20:56:11 +02:00
## CLEANING ~/.zen/tmp
rm -Rf ~/.zen/tmp
mkdir -p ~/.zen/tmp
2022-09-23 14:57:04 +02:00
## RESTART IPFS DAEMON
# echo "$USER ALL=(ALL) NOPASSWD:/bin/systemctl" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/systemctl')
[[ -s /etc/sudoers.d/systemctl ]] && sudo systemctl restart ipfs && sleep 5
## PROCESS TW BACKOFFICE TREATMENT
2022-09-14 14:29:19 +02:00
cd ~/.zen/Astroport.ONE/
git pull
2022-10-01 16:18:15 +02:00
## SOON /ipns/ Address !!!
2022-09-14 14:29:19 +02:00
2022-10-01 16:18:15 +02:00
# Refresh ~/.zen/game/world/G1VOEU
# NOW RUN FROM PLAYER.refresh.sh !! ~/.zen/Astroport.ONE/ASTROBOT/VOEUX.refresh.sh
2022-09-12 11:36:39 +02:00
2022-10-24 02:50:45 +02:00
## CLOSING 1234 REDIRECT
killall 12345.sh
killall nc
2022-10-01 16:18:15 +02:00
# Refresh ~/.zen/game/players/PLAYER
~/.zen/Astroport.ONE/ASTROBOT/PLAYER.refresh.sh
2022-09-12 11:36:39 +02:00
2022-10-24 02:50:45 +02:00
## OPEN ENTRANCE AGAIN
2022-10-25 02:11:46 +02:00
~/.zen/Astroport.ONE/12345.sh > ~/.zen/tmp/12345.log &
2022-09-23 14:57:04 +02:00
if [[ ! $isLAN ]]; then
## REFRESH BOOTSTRAP LIST (OFFICIAL SWARM)
ipfs bootstrap rm --all > /dev/null 2>&1
for bootnode in $(cat ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | grep -Ev "#") # remove comments
do
ipfsnodeid=${bootnode##*/}
ipfs bootstrap add $bootnode
done
fi
2022-09-23 14:57:04 +02:00
2022-09-12 11:36:39 +02:00
########################################################################
end=`date +%s`
echo "20H12 (♥‿‿♥) Execution time was "`expr $end - $start` seconds.
2022-11-04 20:08:33 +01:00
## MAIL LOG : support@qo-op.com
$MY_PATH/tools/mailjet.sh "support@qo-op.com" "/tmp/20h12.log.txt"
2022-09-12 11:36:39 +02:00
exit 0