SMSAPP runs on taurus
This commit is contained in:
parent
9d216f6550
commit
2c2c9aaf02
105
cron_MINUTE.sh
105
cron_MINUTE.sh
|
@ -49,10 +49,10 @@ ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` 2>&1>/dev/null && echo
|
||||||
# WARNING: This script must be processing less than 1 minute, so do not charge too much this script
|
# WARNING: This script must be processing less than 1 minute, so do not charge too much this script
|
||||||
# _ _____ ____ _ _______ ________ ____
|
# _ _____ ____ _ _______ ________ ____
|
||||||
# | | / / | / __ \/ | / / _/ | / / ____/ / / /
|
# | | / / | / __ \/ | / / _/ | / / ____/ / / /
|
||||||
# | | /| / / /| | / /_/ / |/ // // |/ / / __ / / /
|
# | | /| / / /| | / /_/ / |/ // // |/ / / __ / / /
|
||||||
# | |/ |/ / ___ |/ _, _/ /| // // /| / /_/ / /_/_/
|
# | |/ |/ / ___ |/ _, _/ /| // // /| / /_/ / /_/_/
|
||||||
# |__/|__/_/ |_/_/ |_/_/ |_/___/_/ |_/\____/ (_|_)
|
# |__/|__/_/ |_/_/ |_/_/ |_/___/_/ |_/\____/ (_|_)
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# 'figlet' was used for labeling code trunks
|
# 'figlet' was used for labeling code trunks
|
||||||
########################################################################
|
########################################################################
|
||||||
|
@ -104,27 +104,28 @@ echo "RUNTIME $runtime mn ($timebar)"
|
||||||
########################################################################
|
########################################################################
|
||||||
# DEFCON
|
# DEFCON
|
||||||
########################################################################
|
########################################################################
|
||||||
# STATION CAN MODIFY DEFCON (cool 5 to 1 war) - only 5 and 4 (fail2ban) are ready to use.
|
# STATION CAN MODIFY DEFCON (cool 5 to 1 war) - only 5 and 4 (fail2ban) are ready to use.
|
||||||
[[ -f ~/.zen/DEFCON ]] && export DEFCON=$(cat ~/.zen/DEFCON) || export DEFCON=$(cat ~/.zen/astrXbian/DEFCON) # ADAPT $DEFCON scenario
|
[[ -f ~/.zen/DEFCON ]] && export DEFCON=$(cat ~/.zen/DEFCON) || export DEFCON=$(cat ~/.zen/astrXbian/DEFCON) # ADAPT $DEFCON scenario
|
||||||
## DEFCON SYSTEM ACTIVATED
|
## DEFCON SYSTEM ACTIVATED
|
||||||
|
|
||||||
# _ ____
|
# _ ____
|
||||||
# / | | ___| _ __ ___ _ __
|
# / | | ___| _ __ ___ _ __
|
||||||
# | | |___ \ | '_ ` _ \| '_ \
|
# | | |___ \ | '_ ` _ \| '_ \
|
||||||
# | | ___) | | | | | | | | | |
|
# | | ___) | | | | | | | | | |
|
||||||
# |_| |____/ |_| |_| |_|_| |_|
|
# |_| |____/ |_| |_| |_|_| |_|
|
||||||
#
|
#
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# SMARM MAINTENANCE / 15 mn
|
# SMARM MAINTENANCE / 15 mn
|
||||||
########################################################################
|
########################################################################
|
||||||
# astrXbian TestNET (git pull) -> desactivate in release ipfs get codeID
|
# astrXbian TestNET (git pull) -> desactivate in release ipfs get codeID
|
||||||
########################################################################
|
########################################################################
|
||||||
# ACTIVATE 15-17 MN "git pull" update
|
# ACTIVATE 15-17 MN "git pull" update
|
||||||
if [[ $(($minute % 15)) == 0 ]]; then
|
if [[ $(($minute % 15)) == 0 ]]; then
|
||||||
########## NextCloud.SMS GUILDE STATION ##############
|
########## NextCloud.SMS GUILDE STATION ##############
|
||||||
if [[ -e ~/.zen/SMS/ ]];then
|
if [[ -e ~/.zen/SMS/ ]];then
|
||||||
[[ "$timebar" == "18:30" ]] && /home/${YOU}/.zen/SMSAPP/sms/_SEND2GUILDE.sh "BIODYN" ## PREPARE BIODYN GUILDE SMS => 20h30 in France
|
# DONE at 20h01 in taurus crontab
|
||||||
|
# [[ "$timebar" == "18:30" ]] && /home/${YOU}/.zen/SMSAPP/sms/_SEND2GUILDE.sh "BIODYN" ## PREPARE BIODYN GUILDE SMS => 20h30 in France
|
||||||
/home/${YOU}/.zen/SMSAPP/sms_send_tosend.sh
|
/home/${YOU}/.zen/SMSAPP/sms_send_tosend.sh
|
||||||
fi
|
fi
|
||||||
########## SMS GUILDE STATION ##############
|
########## SMS GUILDE STATION ##############
|
||||||
|
@ -139,13 +140,13 @@ if [[ $(($minute % 15)) == 0 ]]; then
|
||||||
# echo "MAJ Vstream settings"
|
# echo "MAJ Vstream settings"
|
||||||
# fi
|
# fi
|
||||||
|
|
||||||
## IN CASE OF jaklis UPGRADE ACTIVATE AND REMOVE
|
## IN CASE OF jaklis UPGRADE ACTIVATE AND REMOVE
|
||||||
## cd ~/.zen/astrXbian/zen/jaklis; ./setup.sh; cd -
|
## cd ~/.zen/astrXbian/zen/jaklis; ./setup.sh; cd -
|
||||||
|
|
||||||
# CLEAN AND REMOVE BAD DIRECTORIES
|
# CLEAN AND REMOVE BAD DIRECTORIES
|
||||||
## BYPASS index.html DELETION
|
## BYPASS index.html DELETION
|
||||||
[[ -f ~/.zen/ipfs/index.html ]] && cp ~/.zen/ipfs/index.html /tmp/ipfsindex.html
|
[[ -f ~/.zen/ipfs/index.html ]] && cp ~/.zen/ipfs/index.html /tmp/ipfsindex.html
|
||||||
|
|
||||||
[[ -d ~/.zen/ipfs/astroport ]] && rm -Rf ~/.zen/ipfs/astroport
|
[[ -d ~/.zen/ipfs/astroport ]] && rm -Rf ~/.zen/ipfs/astroport
|
||||||
[[ -d ~/.zen/ipfs_swarm/astroport ]] && rm -Rf ~/.zen/ipfs_swarm/astroport
|
[[ -d ~/.zen/ipfs_swarm/astroport ]] && rm -Rf ~/.zen/ipfs_swarm/astroport
|
||||||
[[ -d ~/.zen/ipfs/xbian ]] && rm -Rf ~/.zen/ipfs/xbian
|
[[ -d ~/.zen/ipfs/xbian ]] && rm -Rf ~/.zen/ipfs/xbian
|
||||||
|
@ -157,27 +158,27 @@ if [[ $(($minute % 15)) == 0 ]]; then
|
||||||
rm ~/.zen/ipfs/.*
|
rm ~/.zen/ipfs/.*
|
||||||
rm ~/.zen/ipfs_swarm/*
|
rm ~/.zen/ipfs_swarm/*
|
||||||
rm ~/.zen/ipfs_swarm/.*
|
rm ~/.zen/ipfs_swarm/.*
|
||||||
|
|
||||||
## RESTORE index.html from /tmp/ipfsindex.html
|
## RESTORE index.html from /tmp/ipfsindex.html
|
||||||
[[ -f /tmp/ipfsindex.html ]] && mv /tmp/ipfsindex.html ~/.zen/ipfs/index.html
|
[[ -f /tmp/ipfsindex.html ]] && mv /tmp/ipfsindex.html ~/.zen/ipfs/index.html
|
||||||
|
|
||||||
## PING ALL MY FRIENDS TO ENHANCE SWARM CONNECTIVITY
|
## PING ALL MY FRIENDS TO ENHANCE SWARM CONNECTIVITY
|
||||||
echo "## FRIENDS IPFS PINGing"
|
echo "## FRIENDS IPFS PINGing"
|
||||||
for g1pub in $(ls -t ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/); do [[ $g1pub ]] && ipfs ping --timeout=5s -n 3 /ipfs/$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1pub 2>/dev/null) 2>/dev/null; done
|
for g1pub in $(ls -t ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/); do [[ $g1pub ]] && ipfs ping --timeout=5s -n 3 /ipfs/$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $g1pub 2>/dev/null) 2>/dev/null; done
|
||||||
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# __ __ _____ ____
|
# __ __ _____ ____
|
||||||
# __/ // /_/ ___/ ______ __________ ___ / __ \
|
# __/ // /_/ ___/ ______ __________ ___ / __ \
|
||||||
# /_ _ __/\__ \ | /| / / __ `/ ___/ __ `__ \/ / / /
|
# /_ _ __/\__ \ | /| / / __ `/ ___/ __ `__ \/ / / /
|
||||||
# /_ _ __/___/ / |/ |/ / /_/ / / / / / / / / /_/ /
|
# /_ _ __/___/ / |/ |/ / /_/ / / / / / / / / /_/ /
|
||||||
# /_//_/ /____/|__/|__/\__,_/_/ /_/ /_/ /_/\____/ gchange sync
|
# /_//_/ /____/|__/|__/\__,_/_/ /_/ /_/ /_/\____/ gchange sync
|
||||||
#
|
#
|
||||||
##################################################################
|
##################################################################
|
||||||
# TODO: IDEA make gchange/ipfs/ipns refresh speed depending on ipfs swarm size and DEFCON level !
|
# TODO: IDEA make gchange/ipfs/ipns refresh speed depending on ipfs swarm size and DEFCON level !
|
||||||
## SYNC GCHANGE EVERY 1 hour runtime
|
## SYNC GCHANGE EVERY 1 hour runtime
|
||||||
[[ $(($runtime % 60)) == 0 ]] && $MY_PATH/zen/gchange_INIT.sh && $MY_PATH/zen/gchange_IPFS_swarm.sh &
|
[[ $(($runtime % 60)) == 0 ]] && $MY_PATH/zen/gchange_INIT.sh && $MY_PATH/zen/gchange_IPFS_swarm.sh &
|
||||||
|
|
||||||
# QUICK SYNC SWARM EVERY 20 minutes +/- 30 sec
|
# QUICK SYNC SWARM EVERY 20 minutes +/- 30 sec
|
||||||
[[ $(($runtime % 20)) == 0 ]] && sleep $((1 + RANDOM % 30)) && $MY_PATH/zen/ipfs_FRIENDS_refresh.sh &
|
[[ $(($runtime % 20)) == 0 ]] && sleep $((1 + RANDOM % 30)) && $MY_PATH/zen/ipfs_FRIENDS_refresh.sh &
|
||||||
|
@ -186,13 +187,13 @@ fi
|
||||||
# ACTIVATE ~/astroport directory monitoring (xbian only)
|
# ACTIVATE ~/astroport directory monitoring (xbian only)
|
||||||
########################################################################
|
########################################################################
|
||||||
###
|
###
|
||||||
# _ _
|
# _ _
|
||||||
# __ _| |__ (_) __ _ _ __
|
# __ _| |__ (_) __ _ _ __
|
||||||
# \ \/ / '_ \| |/ _` | '_ \
|
# \ \/ / '_ \| |/ _` | '_ \
|
||||||
# > <| |_) | | (_| | | | |
|
# > <| |_) | | (_| | | | |
|
||||||
# /_/\_\_.__/|_|\__,_|_| |_| inotifywait
|
# /_/\_\_.__/|_|\__,_|_| |_| inotifywait
|
||||||
#
|
#
|
||||||
# ON Rpi/xbian files added in ~/astroport are monitored to activate "new_file_in_astroport.sh"
|
# ON Rpi/xbian files added in ~/astroport are monitored to activate "new_file_in_astroport.sh"
|
||||||
# Transfert ~/astroport/*/files to IPFS and make Astroport/KODI indexes in IPNS
|
# Transfert ~/astroport/*/files to IPFS and make Astroport/KODI indexes in IPNS
|
||||||
if [[ "$USER" == "xbian" ]]; then
|
if [[ "$USER" == "xbian" ]]; then
|
||||||
[[ ! -e $HOME/astroport ]] && mkdir -p $HOME/astroport
|
[[ ! -e $HOME/astroport ]] && mkdir -p $HOME/astroport
|
||||||
|
@ -207,13 +208,13 @@ fi
|
||||||
##########################################################
|
##########################################################
|
||||||
|
|
||||||
##################################################################
|
##################################################################
|
||||||
#
|
#
|
||||||
# _________ ______
|
# _________ ______
|
||||||
# ____ ___ ____ /_ __/ | / ____/
|
# ____ ___ ____ /_ __/ | / ____/
|
||||||
# /_ / / _ \/ __ \ / / / /| |/ / __
|
# /_ / / _ \/ __ \ / / / /| |/ / __
|
||||||
# / /_/ __/ / / / / / / ___ / /_/ /
|
# / /_/ __/ / / / / / / ___ / /_/ /
|
||||||
# /___/\___/_/ /_/ /_/ /_/ |_\____/
|
# /___/\___/_/ /_/ /_/ /_/ |_\____/
|
||||||
#
|
#
|
||||||
# REFRESHing MEDIAKEY / ZenTAG nano DHTs => Zen File ECONOMY wallet cycle
|
# REFRESHing MEDIAKEY / ZenTAG nano DHTs => Zen File ECONOMY wallet cycle
|
||||||
if [[ "$timebar" == "12:12" || "$timebar" == "00:12" || "$timebar" == "03:03" || $(($runtime % 720)) == 0 || $runtime == 12 ]]; then
|
if [[ "$timebar" == "12:12" || "$timebar" == "00:12" || "$timebar" == "03:03" || $(($runtime % 720)) == 0 || $runtime == 12 ]]; then
|
||||||
# Every 12h runtime restarting IPFS daemon
|
# Every 12h runtime restarting IPFS daemon
|
||||||
|
@ -221,8 +222,8 @@ if [[ "$timebar" == "12:12" || "$timebar" == "00:12" || "$timebar" == "03:03" ||
|
||||||
[[ "$timebar" == "03:03" ]] && [[ ${YOU} == "xbian" ]] && sudo service ipfs restart && exit 0
|
[[ "$timebar" == "03:03" ]] && [[ ${YOU} == "xbian" ]] && sudo service ipfs restart && exit 0
|
||||||
|
|
||||||
#### Refresh & publish MEDIAKEYs
|
#### Refresh & publish MEDIAKEYs
|
||||||
$MY_PATH/zen/ipns_TAG_refresh.sh
|
$MY_PATH/zen/ipns_TAG_refresh.sh
|
||||||
|
|
||||||
## REINIT dead swarm STATIONS
|
## REINIT dead swarm STATIONS
|
||||||
rm -f ~/.zen/A_dead_swarm.txt
|
rm -f ~/.zen/A_dead_swarm.txt
|
||||||
fi
|
fi
|
||||||
|
@ -236,10 +237,10 @@ if [[ "$timebar" == "00:01" || "$runtime" == "5" || $(($runtime % 1380)) == 0 ]]
|
||||||
echo '
|
echo '
|
||||||
# ____ ____ ____ ___
|
# ____ ____ ____ ___
|
||||||
# / __ \/ __ \ _ / __ < /
|
# / __ \/ __ \ _ / __ < /
|
||||||
# / / / / / / / (_) / / / / /
|
# / / / / / / / (_) / / / / /
|
||||||
# / /_/ / /_/ / _ / /_/ / /
|
# / /_/ / /_/ / _ / /_/ / /
|
||||||
# \____/\____/ (_) \____/_/
|
# \____/\____/ (_) \____/_/
|
||||||
#
|
#
|
||||||
# MAINTENANCE
|
# MAINTENANCE
|
||||||
'
|
'
|
||||||
sleep $((1 + RANDOM % 15)) ### Be careful if random sleep is not activated...
|
sleep $((1 + RANDOM % 15)) ### Be careful if random sleep is not activated...
|
||||||
|
@ -251,17 +252,17 @@ echo '
|
||||||
# REFRESH & UPGRADE youtube-dl
|
# REFRESH & UPGRADE youtube-dl
|
||||||
youtube-dl --rm-cache-dir
|
youtube-dl --rm-cache-dir
|
||||||
youtube-dl -U
|
youtube-dl -U
|
||||||
|
|
||||||
|
|
||||||
##################################################################
|
##################################################################
|
||||||
if [[ $dayoftheweek == 1 ]]; then
|
if [[ $dayoftheweek == 1 ]]; then
|
||||||
# EVERY MONDAY
|
# EVERY MONDAY
|
||||||
# _____ __ __ ___
|
# _____ __ __ ___
|
||||||
# / ___// /_____ _________ _____ ____ / |/ /___ __ __
|
# / ___// /_____ _________ _____ ____ / |/ /___ __ __
|
||||||
# \__ \/ __/ __ \/ ___/ __ `/ __ `/ _ \ / /|_/ / __ `/ |/_/
|
# \__ \/ __/ __ \/ ___/ __ `/ __ `/ _ \ / /|_/ / __ `/ |/_/
|
||||||
# ___/ / /_/ /_/ / / / /_/ / /_/ / __/ / / / / /_/ /> <
|
# ___/ / /_/ /_/ / / / /_/ / /_/ / __/ / / / / /_/ /> <
|
||||||
# /____/\__/\____/_/ \__,_/\__, /\___/ /_/ /_/\__,_/_/|_|
|
# /____/\__/\____/_/ \__,_/\__, /\___/ /_/ /_/\__,_/_/|_|
|
||||||
# /____/
|
# /____/
|
||||||
# 1/2 HDD for IPFS size - dicotomic adaptation 7th EVERY MONTH
|
# 1/2 HDD for IPFS size - dicotomic adaptation 7th EVERY MONTH
|
||||||
availableDiskSize=$(df -P ~/ | awk 'NR>1{sum+=$4}END{print sum}')
|
availableDiskSize=$(df -P ~/ | awk 'NR>1{sum+=$4}END{print sum}')
|
||||||
availableDiskSize="$(($availableDiskSize * 1024))"
|
availableDiskSize="$(($availableDiskSize * 1024))"
|
||||||
|
@ -269,25 +270,25 @@ echo '
|
||||||
diskSize="$((availableDiskSize / 2))"
|
diskSize="$((availableDiskSize / 2))"
|
||||||
ipfs config Datastore.StorageMax $diskSize
|
ipfs config Datastore.StorageMax $diskSize
|
||||||
echo "StorageMax = $diskSize"
|
echo "StorageMax = $diskSize"
|
||||||
|
|
||||||
# New full test review in gchange_INIT.sh
|
# New full test review in gchange_INIT.sh
|
||||||
rm -f ~/.ipfs/test.disk
|
rm -f ~/.ipfs/test.disk
|
||||||
|
|
||||||
# LOG ROTATE WEEKLY
|
# LOG ROTATE WEEKLY
|
||||||
[[ -f /tmp/astroport.log ]] && [[ ! -f ~/.zen/astroport.$weeknumber.log.tgz ]] && tar cvzf ~/.zen/astroport.$weeknumber.log.tgz /tmp/astroport.log && echo "" > /tmp/astroport.log
|
[[ -f /tmp/astroport.log ]] && [[ ! -f ~/.zen/astroport.$weeknumber.log.tgz ]] && tar cvzf ~/.zen/astroport.$weeknumber.log.tgz /tmp/astroport.log && echo "" > /tmp/astroport.log
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
##################################################################
|
##################################################################
|
||||||
## CHECK STARTGATE LEVEL KEYS
|
## CHECK STARTGATE LEVEL KEYS
|
||||||
# _ open _
|
# _ open _
|
||||||
# ___| |_ __ _ _ __ __ _ __ _| |_ ___
|
# ___| |_ __ _ _ __ __ _ __ _| |_ ___
|
||||||
#/ __| __/ _` | '__/ _` |/ _` | __/ _ \
|
#/ __| __/ _` | '__/ _` |/ _` | __/ _ \
|
||||||
#\__ \ || (_| | | | (_| | (_| | || __/
|
#\__ \ || (_| | | | (_| | (_| | || __/
|
||||||
#|___/\__\__,_|_| \__, |\__,_|\__\___|
|
#|___/\__\__,_|_| \__, |\__,_|\__\___|
|
||||||
# |___/
|
# |___/
|
||||||
# IPNS KEYS used to publish with star friends (creates 5 levels of streaming / file sharing)
|
# IPNS KEYS used to publish with star friends (creates 5 levels of streaming / file sharing)
|
||||||
# RESET
|
# RESET
|
||||||
ipfs key rm star_1; ipfs key rm star_2; ipfs key rm star_3; ipfs key rm star_4; ipfs key rm star_5
|
ipfs key rm star_1; ipfs key rm star_2; ipfs key rm star_3; ipfs key rm star_4; ipfs key rm star_5
|
||||||
rm -Rf ~/.zen/key/
|
rm -Rf ~/.zen/key/
|
||||||
# RENEW & SEND STARS TO FRIENDS ~/.zen/astrXbian/zen/manage_stargates.sh
|
# RENEW & SEND STARS TO FRIENDS ~/.zen/astrXbian/zen/manage_stargates.sh
|
||||||
|
@ -296,7 +297,7 @@ echo '
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### DISAPEAR ONE HOUR FROM IPFS SWARM ZOMBIES > 300 peers in swarm
|
### DISAPEAR ONE HOUR FROM IPFS SWARM ZOMBIES > 300 peers in swarm
|
||||||
#if [[ $(cat /tmp/ipfs_swarm_peers | wc -l) -gt 300 ]]; then
|
#if [[ $(cat /tmp/ipfs_swarm_peers | wc -l) -gt 300 ]]; then
|
||||||
#if [[ "$timebar" == "04:05" ]]; then
|
#if [[ "$timebar" == "04:05" ]]; then
|
||||||
# ~/.zen/astrXbian/zen/ipfs_SWARM_renew.sh 3600 ## CUT IPFS FOR ONE HOUR
|
# ~/.zen/astrXbian/zen/ipfs_SWARM_renew.sh 3600 ## CUT IPFS FOR ONE HOUR
|
||||||
## SWITCHING ON
|
## SWITCHING ON
|
||||||
|
|
Loading…
Reference in New Issue