This commit is contained in:
qo-op 2020-05-18 03:58:04 +02:00
parent dd5748cd2c
commit d5466612cb
2 changed files with 26 additions and 12 deletions

View File

@ -8,6 +8,12 @@ MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
####
# Add search in code "TODO".
# Write what you thing about the situation
# AND how you would like to 'fix it'...
# Then friends can read and enhance solution.
# _ _____ ____ _ _______ ________ ____
# | | / / | / __ \/ | / / _/ | / / ____/ / / /
# | | /| / / /| | / /_/ / |/ // // |/ / / __ / / /
@ -15,12 +21,14 @@ ME="${0##*/}"
# |__/|__/_/ |_/_/ |_/_/ |_/___/_/ |_/\____/ (_|_)
########################################################################
# NB: 'figlet' is used for labeling code trunks
########################################################################
### MODIFY WITH GREAT CARE!!! MUST BE BUG FREE !!!!!
### EVERY STATION RUN THIS SCRIPT EVERY MINUTE.
export isMinetestRunning=$(ps auxf --sort=+utime | grep -w minetest | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1)
export isG1smsRunning=$(ps auxf --sort=+utime | grep -w gammu | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1)
#isNextcloudRunning=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1)
### ACTIVATE DIFFERENT FLAVOURS
# ? isNextcloudRunning=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1)
### DETECT FLAVOURS (TODO: Publish and share into ipfs/.Qm***/ )
########################################################################
[[ ! $(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" \
@ -32,19 +40,19 @@ export isG1smsRunning=$(ps auxf --sort=+utime | grep -w gammu | grep -v -E 'colo
export YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1);
export IPFSNODEID=$(ipfs id -f='<id>\n')
ipfsnodeid=$(ipfs id -f='<id>\n')
g1pub=$(cat ~/.ssb/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
# UNIVERSAL TIME (TODO ntpdate, but sudo problem)
# UNIVERSAL TIME (TODO ntpdate, but sudo problem...
# G1Tx. G1sms. G1Dab Zen economy needs precise time sync (RpiZero !!)
# Tx rates is limited by Station time synchronisation.
minute=$(date -u +%M)
heure=$(date -u +%H)
timebar="$heure:$minute"
jourdelasemaine=$(date +%w)
jourdumois=$(date +%d)
numerosemaine=$(date +%V)
echo $timebar
echo $timebar | lolcat
# TIME NTP SYNC: TODO: Problem being root (stickybit INSTALL?)
# sudo ntpdate ntp.pool.org
@ -95,7 +103,8 @@ echo $timebar
# /_ _ __/ / /_/ __/ / / / /_/ / /_ | |/ /
# /_//_/ /___/\___/_/ /_/\__, /\__/ |___/
# /____/
# SSB message 2 "youtube-dl"
# SSB message 2 "youtube-dl" EXPERIMENTAL
# TODO : Run on BIG STATIONS (Control available Disk Space !!)
##################################################################
# RANDOMLY RUN SSB GET zenytv (avoid simultaneous run in swarm)
randh=$((1 + RANDOM % 24))
@ -115,8 +124,11 @@ randh=$((1 + RANDOM % 24))
##################################################################
# MIDNIGHT:01 : ZENBOT CLEANING & UPDATE
if [[ "$timebar" == "00:01" ]]; then
sleep $((1 + RANDOM % 10))
sleep $((1 + RANDOM % 10)) ### Be careful if random sleep is not activated...
############################## That swarm could become an aggressive blob !!
### PEACE & LOVE software is processing... We are HyperWeb people here.
# DEFCON 5 code runin' please keep cool, take care and be zen
# UPGRADE youtube-dl
youtube-dl --rm-cache-dir
youtube-dl -U
@ -144,9 +156,11 @@ fi
# ___/ / /_/ /_/ / / / /_/ / /_/ / __/ / / / / /_/ /> <
# /____/\__/\____/_/ \__,_/\__, /\___/ /_/ /_/\__,_/_/|_|
# /____/
# Always 1/2 HDD for IPFS size - dicotomic adaptation
# UPDATE ON 7th EVERY MONTH
# 1/2 HDD for IPFS size - dicotomic adaptation 7th EVERY MONTH
#
# TODO: Read parameters from ipfs, publish status to swarm, could be use for youtube-dl or other kind of heavy ipfs input Station election.
#
if [[ $jourdumois == 7 ]]; then
availableDiskSize=$(df -P ~/ | awk 'NR>1{sum+=$4}END{print sum}')
diskSize="$((availableDiskSize / 2))"

View File

@ -16,7 +16,7 @@ echo '
# ex: ./'$ME'
# SURVEY received #astroport-swarmkey ipfs_swarm.key.crypt for IPFS
########################################################################
___DESACTIVATED___ TODO testing.
__ __ _ _
(_ (_ |_) _ ._ _ _|_o|
__)__)|_) _>|_||\/(/_\/ | ||(/__>