2020-05-07 17:34:16 +02:00
|
|
|
#!/bin/bash
|
|
|
|
########################################################################
|
|
|
|
# Author: Fred (support@qo-op.com)
|
2020-05-10 23:58:08 +02:00
|
|
|
# Version: 0.3
|
2020-05-07 17:34:16 +02:00
|
|
|
# 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##*/}"
|
2020-05-23 03:57:01 +02:00
|
|
|
|
|
|
|
# CORRECT PATH
|
|
|
|
[[ ! $(echo $PATH | grep "/usr/local/bin") ]] && export PATH="$PATH:/usr/local/bin"
|
|
|
|
[[ ! $(echo $PATH | grep "~/.local/bin") ]] && export PATH="$PATH:~/.local/bin"
|
|
|
|
[[ ! $(echo $PATH | grep "/usr/games") ]] && export PATH="$PATH:/usr/games"
|
|
|
|
|
2020-05-18 03:58:04 +02:00
|
|
|
####
|
2020-05-23 03:28:26 +02:00
|
|
|
export 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"
|
2020-06-06 03:54:36 +02:00
|
|
|
source /home/$YOU/.profile
|
2020-05-23 03:28:26 +02:00
|
|
|
export IPFSNODEID=$(ipfs id -f='<id>\n') || er+=" ipfs id problem"
|
2020-06-06 03:49:24 +02:00
|
|
|
export WHOAMI=$($MY_PATH/zen/tools/timeout.sh -t 3 sbotc whoami | jq -r .id)
|
|
|
|
|
|
|
|
if [[ "$WHOAMI" == "" ]]; then
|
|
|
|
### oasis ssb-server not responding!!!
|
2020-06-06 16:09:53 +02:00
|
|
|
echo "sboc <-> SSB-SERVER IMPOSSIBLE..."
|
2020-06-12 00:49:57 +02:00
|
|
|
kill -9 $(ps auxf --sort=+utime | grep -w 'ssb-server' | grep -v -E 'color=auto|grep' | tail -n 1 | awk '{print $2}')
|
|
|
|
# while true; do ssb-server start; sleep 3; done
|
|
|
|
|
2020-06-06 16:09:53 +02:00
|
|
|
# kill -9 $(ps auxf --sort=+utime | grep -w 'oasis' | grep -v -E 'color=auto|grep' | tail -n 1 | awk '{print $2}')
|
|
|
|
# oasis --allow-host oasis.astroport.com --host oasis.astroport.com &
|
2020-06-06 03:49:24 +02:00
|
|
|
fi
|
2020-05-23 03:28:26 +02:00
|
|
|
########################################################################
|
|
|
|
# HELP DEVLT: Search "TODO" in code
|
2020-05-18 03:58:04 +02:00
|
|
|
# Write what you thing about the situation
|
|
|
|
# AND how you would like to 'fix it'...
|
|
|
|
# Then friends can read and enhance solution.
|
2020-05-19 17:22:46 +02:00
|
|
|
# WARNING: This script must be precessing less than 1 minute, so do not charge too much this script
|
2020-05-10 23:58:08 +02:00
|
|
|
# _ _____ ____ _ _______ ________ ____
|
|
|
|
# | | / / | / __ \/ | / / _/ | / / ____/ / / /
|
|
|
|
# | | /| / / /| | / /_/ / |/ // // |/ / / __ / / /
|
|
|
|
# | |/ |/ / ___ |/ _, _/ /| // // /| / /_/ / /_/_/
|
|
|
|
# |__/|__/_/ |_/_/ |_/_/ |_/___/_/ |_/\____/ (_|_)
|
|
|
|
|
2020-05-18 03:58:04 +02:00
|
|
|
########################################################################
|
|
|
|
# NB: 'figlet' is used for labeling code trunks
|
2020-05-10 23:54:57 +02:00
|
|
|
########################################################################
|
|
|
|
### MODIFY WITH GREAT CARE!!! MUST BE BUG FREE !!!!!
|
2020-05-10 23:58:08 +02:00
|
|
|
### EVERY STATION RUN THIS SCRIPT EVERY MINUTE.
|
2020-05-13 23:27:29 +02:00
|
|
|
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)
|
2020-05-18 03:58:04 +02:00
|
|
|
# ? 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***/ )
|
2020-05-10 23:54:57 +02:00
|
|
|
########################################################################
|
2020-05-23 03:57:01 +02:00
|
|
|
cd $MY_PATH
|
2020-05-18 04:02:31 +02:00
|
|
|
|
2020-05-23 03:28:26 +02:00
|
|
|
# WHAT UNIVERSAL TIME is it ?
|
2020-05-07 17:34:16 +02:00
|
|
|
minute=$(date -u +%M)
|
|
|
|
heure=$(date -u +%H)
|
|
|
|
timebar="$heure:$minute"
|
2020-05-23 03:28:26 +02:00
|
|
|
dayoftheweek=$(date +%w)
|
|
|
|
dayofthemonth=$(date +%d)
|
|
|
|
weeknumber=$(date +%V)
|
2020-05-18 04:35:36 +02:00
|
|
|
|
|
|
|
echo $timebar
|
2020-05-28 17:55:06 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# _________
|
|
|
|
# / ____< /________ ___ _____
|
|
|
|
# / / __ / / ___/ __ `__ \/ ___/
|
|
|
|
#/ /_/ // (__ ) / / / / (__ )
|
|
|
|
#\____//_/____/_/ /_/ /_/____/
|
|
|
|
#
|
|
|
|
$MY_PATH/g1sms/sms_ASTROPORT.sh
|
|
|
|
|
2020-06-11 00:49:03 +02:00
|
|
|
<<<<<<< HEAD
|
2020-06-05 19:58:27 +02:00
|
|
|
####### OPEN PORT TO FORWARD ####### ADMIN ANY NODE (placer à 5 + 1mn)
|
|
|
|
### ADAPT TO ANY IPFSNODEID and TCP port
|
2020-06-06 12:47:12 +02:00
|
|
|
if [[ "$timebar" == "09:46" ]]; then
|
2020-06-06 02:47:37 +02:00
|
|
|
if [[ "$IPFSNODEID" == "QmVywXoBSz7JZ5vunYYVwi72SdTizvFt7k7qd3ooyYHvHA" ]]; then
|
2020-06-06 12:47:12 +02:00
|
|
|
echo '' > /tmp/A_p2pFwd_$IPFSNODEID
|
2020-06-06 02:47:37 +02:00
|
|
|
ipfs p2p close --all
|
|
|
|
ipfs p2p listen /x/g1pub-ssh /ip4/127.0.0.1/tcp/22 # CLOSE WITH ipfs p2p close /x/g1pub-ssh
|
2020-06-06 12:47:12 +02:00
|
|
|
echo "G1smsPub FORWARD: ipfs p2p forward /x/g1pub-ssh /ip4/127.0.0.1/tcp/2021 /p2p/QmVywXoBSz7JZ5vunYYVwi72SdTizvFt7k7qd3ooyYHvHA" >> /tmp/A_p2pFwd_$IPFSNODEID
|
2020-06-06 02:47:37 +02:00
|
|
|
ipfs p2p listen /x/g1pub-http /ip4/127.0.0.1/tcp/80
|
2020-06-06 12:47:12 +02:00
|
|
|
echo "G1smsPub FORWARD: ipfs p2p forward /x/g1pub-http /ip4/127.0.0.1/tcp/8021 /p2p/QmVywXoBSz7JZ5vunYYVwi72SdTizvFt7k7qd3ooyYHvHA" >> /tmp/A_p2pFwd_$IPFSNODEID
|
2020-06-06 02:47:37 +02:00
|
|
|
fi
|
2020-06-08 14:52:31 +02:00
|
|
|
# Start G1sms API push/pull
|
|
|
|
$MY_PATH/zen/ipfs_OPEN_ports.sh
|
2020-06-05 19:33:00 +02:00
|
|
|
fi
|
2020-06-11 00:49:03 +02:00
|
|
|
=======
|
|
|
|
>>>>>>> 75933498b2558f9459fa8345ab26da2eb693334d
|
2020-06-06 02:47:37 +02:00
|
|
|
#if [[ "$timebar" == "18:01" ]]; then
|
|
|
|
#[[ "$IPFSNODEID" == "QmVywXoBSz7JZ5vunYYVwi72SdTizvFt7k7qd3ooyYHvHA" ]] && ipfs p2p listen /x/g1pub-http /ip4/127.0.0.1/tcp/80
|
|
|
|
#echo "G1smsPub FORWARD: ipfs p2p forward /x/g1pub-http /ip4/127.0.0.1/tcp/8021 /p2p/QmVywXoBSz7JZ5vunYYVwi72SdTizvFt7k7qd3ooyYHvHA"
|
|
|
|
#fi
|
|
|
|
|
2020-05-07 17:34:16 +02:00
|
|
|
# TIME NTP SYNC: TODO: Problem being root (stickybit INSTALL?)
|
2020-05-23 03:28:26 +02:00
|
|
|
# G1Tx. G1sms. G1Dab Zen economy needs precise time sync (RpiZero !!)
|
|
|
|
# Tx rates is limited by Station time synchronisation.
|
2020-05-07 17:34:16 +02:00
|
|
|
# sudo ntpdate ntp.pool.org
|
|
|
|
|
2020-05-13 23:27:29 +02:00
|
|
|
# ____ _______ __ __
|
|
|
|
# / __ \/ ____/ | / / ____ ___ ____ ____/ /__
|
|
|
|
# / / / / __/ | | / / / __ `__ \/ __ \/ __ / _ \
|
|
|
|
# / /_/ / /___ | |/ / / / / / / / /_/ / /_/ / __/
|
|
|
|
# /_____/_____/ |___/ /_/ /_/ /_/\____/\__,_/\___/
|
|
|
|
#
|
|
|
|
#
|
2020-05-07 17:34:16 +02:00
|
|
|
# ACTIVATE 5 MN "git pull" update
|
2020-05-21 02:11:38 +02:00
|
|
|
if [[ $(($minute % 5)) == 0 ]]; then
|
|
|
|
sleep $((1 + RANDOM % 12))
|
|
|
|
### Remove files being in .gitignore
|
2020-05-21 02:35:06 +02:00
|
|
|
# git checkout -- www/LOVELand/jukebox/prefs/collection.sq3
|
|
|
|
# git checkout -- www/LOVELand/jukebox/prefs/prefs.var
|
2020-05-21 02:11:38 +02:00
|
|
|
#######################################
|
|
|
|
git pull
|
|
|
|
fi
|
2020-05-07 17:34:16 +02:00
|
|
|
|
2020-05-13 23:27:29 +02:00
|
|
|
# __________ ____ __ ________ ___________
|
|
|
|
# / ___/ ___// __ ) \ \ / _/ __ \/ ____/ ___/
|
|
|
|
# \__ \\__ \/ __ | _____\ \ / // /_/ / /_ \__ \
|
|
|
|
# ___/ /__/ / /_/ / /_____/ / _/ // ____/ __/ ___/ /
|
|
|
|
# /____/____/_____/ /_/ /___/_/ /_/ /____/
|
|
|
|
#
|
|
|
|
# __ __ _____ ____
|
|
|
|
# __/ // /_/ ___/ ______ __________ ___ / __ \
|
|
|
|
# /_ _ __/\__ \ | /| / / __ `/ ___/ __ `__ \/ / / /
|
|
|
|
# /_ _ __/___/ / |/ |/ / /_/ / / / / / / / / /_/ /
|
|
|
|
# /_//_/ /____/|__/|__/\__,_/_/ /_/ /_/ /_/\____/
|
|
|
|
#
|
2020-05-07 17:34:16 +02:00
|
|
|
##################################################################
|
2020-05-23 03:05:05 +02:00
|
|
|
# REFRESH IPFS SWARM DATA EVERY 12 & 15 minutes
|
2020-06-08 04:04:25 +02:00
|
|
|
[[ $(($minute % 12)) == 0 ]] && sleep $((1 + RANDOM % 10)) && $MY_PATH/zen/ssb_IPFS_swarm.sh &
|
|
|
|
[[ $(($minute % 15)) == 0 ]] && sleep $((1 + RANDOM % 10)) && $MY_PATH/zen/ipfs_SWARM_refresh.sh &
|
2020-06-06 12:47:12 +02:00
|
|
|
## TODO investigate could breaks "ipfs p2p" forwards ?
|
2020-05-07 17:34:16 +02:00
|
|
|
##################################################################
|
|
|
|
|
2020-05-13 23:27:29 +02:00
|
|
|
# _________ _______ __ _ __
|
|
|
|
# / ____< / /_ __/ |/ / ____ ___ ____ ____ (_) /_____ _____
|
|
|
|
# / / __ / / / / | / / __ `__ \/ __ \/ __ \/ / __/ __ \/ ___/
|
|
|
|
# / /_/ // / / / / | / / / / / / /_/ / / / / / /_/ /_/ / /
|
|
|
|
# \____//_/ /_/ /_/|_| /_/ /_/ /_/\____/_/ /_/_/\__/\____/_/
|
|
|
|
#
|
2020-05-07 17:34:16 +02:00
|
|
|
##################################################################
|
|
|
|
# MONITOR INPUT TX (TODO: DEBUG)
|
|
|
|
# Activate later for DAB ZenTx Machines
|
|
|
|
# [[ $(($minute % 5)) == 0 ]] && sleep $((1 + RANDOM % 10)) && $MY_PATH/zen/g1_MONITOR_zen.sh "5 minutes"
|
|
|
|
##################################################################
|
|
|
|
|
|
|
|
##################################################################
|
2020-05-13 23:27:29 +02:00
|
|
|
# __ __ __
|
|
|
|
# __/ // /_____ ___ ____ __ __/ /__ __
|
|
|
|
# /_ _ __/_ / / _ \/ __ \/ / / / __/ | / /
|
|
|
|
# /_ _ __/ / /_/ __/ / / / /_/ / /_ | |/ /
|
|
|
|
# /_//_/ /___/\___/_/ /_/\__, /\__/ |___/
|
|
|
|
# /____/
|
2020-05-18 03:58:04 +02:00
|
|
|
# SSB message 2 "youtube-dl" EXPERIMENTAL
|
|
|
|
# TODO : Run on BIG STATIONS (Control available Disk Space !!)
|
2020-05-07 17:34:16 +02:00
|
|
|
##################################################################
|
|
|
|
# RANDOMLY RUN SSB GET zenytv (avoid simultaneous run in swarm)
|
|
|
|
randh=$((1 + RANDOM % 24))
|
2020-06-06 03:26:58 +02:00
|
|
|
if [[ $(($heure % $randh)) == 0 ]]; then
|
|
|
|
diskMBps=$(dd if=/dev/zero of=~/.zen/test.disk bs=10M count=1 oflag=dsync 2>&1 | tail -n 1 | sed s/\,\ /\ -/g | cut -d '-' -f 4 | cut -d ' ' -f 1 | cut -d '.' -f 1)
|
|
|
|
diskGiga=$(df -h ~/.ipfs/ | tail -n 1 | awk '{print $4}' | cut -d 'G' -f '1')
|
|
|
|
echo "GET_zenytv write speed : $diskMBps MB/s"
|
|
|
|
echo "Disk size : $diskGiga GB"
|
|
|
|
sleep $((1 + RANDOM % 10))
|
2020-06-08 04:04:25 +02:00
|
|
|
[[ $diskMBps -gt 15 ]] && [[ $diskGiga -gt 5 ]] && $MY_PATH/zen/ssb_GET_zenytv.sh &
|
2020-06-06 03:26:58 +02:00
|
|
|
|
|
|
|
fi
|
2020-05-07 17:34:16 +02:00
|
|
|
##################################################################
|
|
|
|
randh=$((1 + RANDOM % 24))
|
2020-06-06 03:26:58 +02:00
|
|
|
if [[ $(($heure % $randh)) == 0 ]]; then
|
|
|
|
diskMBps=$(dd if=/dev/zero of=~/.zen/test.disk bs=10M count=1 oflag=dsync 2>&1 | tail -n 1 | sed s/\,\ /\ -/g | cut -d '-' -f 4 | cut -d ' ' -f 1 | cut -d '.' -f 1)
|
2020-06-08 14:52:31 +02:00
|
|
|
diskGiga=$(df -h ~/.ipfs/ | tail -n 1 | awk '{print $4}' | cut -d 'G' -f '1' | cut -d '.' -f 1 )
|
2020-06-06 03:26:58 +02:00
|
|
|
echo "ssb_GET_zenyta write speed : $diskMBps MB/s"
|
|
|
|
echo "Disk size : $diskGiga GB"
|
|
|
|
# You can modify limit for a station to act ( > 15MB/s && > 5GB )
|
|
|
|
sleep $((1 + RANDOM % 10))
|
2020-06-08 04:04:25 +02:00
|
|
|
[[ $diskMBps -gt 15 ]] && [[ $diskGiga -gt 5 ]] && $MY_PATH/zen/ssb_GET_zenyta.sh &
|
2020-06-06 03:26:58 +02:00
|
|
|
fi
|
2020-05-07 17:34:16 +02:00
|
|
|
##################################################################
|
|
|
|
|
2020-06-06 04:06:24 +02:00
|
|
|
##################################################################
|
|
|
|
############ ASTROPORT LAUNCHING DATE 12:12 (HOUR is UTC)
|
2020-06-06 05:22:18 +02:00
|
|
|
TODAY=$(date -u '+%Y%m%d')
|
2020-06-08 03:54:51 +02:00
|
|
|
if [[ "$timebar" == "10:12" ]]; then
|
2020-06-05 19:58:27 +02:00
|
|
|
echo '
|
2020-06-06 02:47:37 +02:00
|
|
|
_____ ___ ___ __ __ _
|
|
|
|
|__ / |__ \ < / / /___ ___ ______ _____/ /_ (_)___ ____ _
|
|
|
|
/_ < __/ / / / / / __ `/ / / / __ \/ ___/ __ \/ / __ \/ __ `/
|
|
|
|
___/ / / __/ / /_ _ _ / / /_/ / /_/ / / / / /__/ / / / / / / / /_/ /
|
|
|
|
/____/ /____/ /_/(_|_|_) /_/\__,_/\__,_/_/ /_/\___/_/ /_/_/_/ /_/\__, /
|
|
|
|
/____/
|
2020-06-06 04:06:24 +02:00
|
|
|
ASTROPORT NOW... automate cellulaire - blob à rétrocontrole humain COLLECTIVE INIT
|
2020-06-05 19:58:27 +02:00
|
|
|
'
|
2020-06-08 03:54:51 +02:00
|
|
|
echo "$TODAY 12:12 - GCHANGE MARKET 10km SCAN"
|
2020-06-06 04:06:24 +02:00
|
|
|
sleep $((1 + RANDOM % 10))
|
2020-06-08 04:04:25 +02:00
|
|
|
$MY_PATH/zen/gchange_MONITOR.sh &
|
2020-06-05 19:58:27 +02:00
|
|
|
fi
|
2020-06-06 03:26:58 +02:00
|
|
|
##################################################################
|
|
|
|
##################################################################
|
2020-06-06 04:06:24 +02:00
|
|
|
|
|
|
|
|
2020-06-06 03:26:58 +02:00
|
|
|
##################################################################
|
2020-05-23 03:28:26 +02:00
|
|
|
##################################################################
|
|
|
|
# MIDNIGHT:01 : ZENBOT CLEANING & UPDATE
|
2020-06-06 03:26:58 +02:00
|
|
|
##################################################################
|
|
|
|
##################################################################
|
2020-05-23 03:28:26 +02:00
|
|
|
if [[ "$timebar" == "00:01" ]]; then
|
|
|
|
echo '
|
2020-05-13 23:27:29 +02:00
|
|
|
# ____ ____ ____ ___
|
|
|
|
# / __ \/ __ \ _ / __ < /
|
|
|
|
# / / / / / / / (_) / / / / /
|
|
|
|
# / /_/ / /_/ / _ / /_/ / /
|
|
|
|
# \____/\____/ (_) \____/_/
|
|
|
|
#
|
2020-06-06 03:26:58 +02:00
|
|
|
# Clean & Upgrade + Log rotation + git pull + ipfs p2p port forward refresh, etc...
|
2020-05-23 03:28:26 +02:00
|
|
|
'
|
2020-05-23 03:40:03 +02:00
|
|
|
sleep $((1 + RANDOM % 5)) ### Be careful if random sleep is not activated...
|
2020-05-18 03:58:04 +02:00
|
|
|
############################## That swarm could become an aggressive blob !!
|
|
|
|
### PEACE & LOVE software is processing... We are HyperWeb people here.
|
2020-05-23 03:40:03 +02:00
|
|
|
# DEFCON 5 quiet behaviour so Please keep cool, take care and be zen.
|
|
|
|
# GOOD BYE GOOGLE, AMAZON, FACEBOOK, APPLE, MICROSOFT. We don't need you.
|
2020-06-06 03:26:58 +02:00
|
|
|
##################################################################
|
|
|
|
# REFRESH & UPGRADE youtube-dl
|
2020-05-07 17:34:16 +02:00
|
|
|
youtube-dl --rm-cache-dir
|
|
|
|
youtube-dl -U
|
2020-06-06 03:26:58 +02:00
|
|
|
#### DESYNC
|
2020-05-23 03:40:03 +02:00
|
|
|
sleep $((1 + RANDOM % 5))
|
2020-06-06 03:26:58 +02:00
|
|
|
##################################################################
|
2020-06-06 05:22:18 +02:00
|
|
|
# ssb_INIT + LOG ROTATE EVERY SUNDAY # TODO /var/log/ + logrotate (& tempfiles in /tmp in RAMFS)
|
2020-06-08 04:04:25 +02:00
|
|
|
if [[ $dayoftheweek == 0 ]]; then
|
|
|
|
$MY_PATH/zen/ssb_INIT.sh &
|
|
|
|
tar cvzf ~/.zen/astroport.$weeknumber.log.tgz /tmp/astroport.log # LOG BACKUP FOR 1 YEAR !!
|
|
|
|
fi
|
2020-06-06 03:26:58 +02:00
|
|
|
#### DESYNC
|
2020-05-23 03:40:03 +02:00
|
|
|
sleep $((1 + RANDOM % 5))
|
2020-06-06 03:26:58 +02:00
|
|
|
##################################################################
|
2020-05-21 02:11:38 +02:00
|
|
|
# GIT UPDATE
|
|
|
|
./git-update.sh
|
2020-05-07 17:34:16 +02:00
|
|
|
git pull # UPDATE CODE git pull
|
2020-06-06 03:26:58 +02:00
|
|
|
##################################################################
|
2020-05-07 17:34:16 +02:00
|
|
|
# Clear 24h ssb_GET markers
|
|
|
|
rm ~/.zen/zenytv.last.ts
|
|
|
|
rm ~/.zen/zenyta.last.ts
|
2020-06-06 03:26:58 +02:00
|
|
|
##################################################################
|
2020-05-23 03:05:05 +02:00
|
|
|
echo '
|
|
|
|
_________
|
|
|
|
/ ____< / _________ ___ _____
|
|
|
|
/ / __ / / / ___/ __ `__ \/ ___/
|
|
|
|
/ /_/ // / (__ ) / / / / (__ )
|
|
|
|
\____//_/ /____/_/ /_/ /_/____/
|
|
|
|
|
2020-06-06 02:47:37 +02:00
|
|
|
HTTP API forwarding to http://127.0.0.1:10099
|
2020-05-23 03:05:05 +02:00
|
|
|
'
|
2020-06-09 21:52:29 +02:00
|
|
|
echo '' > /tmp/A_P2Pforward
|
2020-05-23 03:05:05 +02:00
|
|
|
ipfs p2p close --all
|
2020-06-09 21:52:29 +02:00
|
|
|
####### OPEN PORT TO FORWARD ####### ADMIN ANY NODE (placer à 5 + 1mn)
|
|
|
|
### ADAPT TO ANY IPFSNODEID and TCP port
|
|
|
|
if [[ "$IPFSNODEID" == "QmVywXoBSz7JZ5vunYYVwi72SdTizvFt7k7qd3ooyYHvHA" ]]; then
|
|
|
|
ipfs p2p listen /x/g1pub-ssh /ip4/127.0.0.1/tcp/22 # CLOSE WITH ipfs p2p close /x/g1pub-ssh
|
|
|
|
ipfs p2p listen /x/g1pub-http /ip4/127.0.0.1/tcp/80
|
|
|
|
fi
|
|
|
|
echo "G1smsPub FORWARD: ipfs p2p forward /x/g1pub-ssh /ip4/127.0.0.1/tcp/2021 /p2p/QmVywXoBSz7JZ5vunYYVwi72SdTizvFt7k7qd3ooyYHvHA" >> /tmp/A_P2Pforward
|
|
|
|
echo "G1smsPub FORWARD: ipfs p2p forward /x/g1pub-http /ip4/127.0.0.1/tcp/8021 /p2p/QmVywXoBSz7JZ5vunYYVwi72SdTizvFt7k7qd3ooyYHvHA" >> /tmp/A_P2Pforward
|
2020-05-23 03:28:26 +02:00
|
|
|
./zen/ipfs_OPEN_ports.sh
|
2020-05-23 03:05:05 +02:00
|
|
|
ipfs p2p ls
|
2020-06-06 03:26:58 +02:00
|
|
|
##################################################################
|
2020-06-09 21:52:29 +02:00
|
|
|
|
2020-05-23 03:40:03 +02:00
|
|
|
echo '
|
|
|
|
_________ ______
|
|
|
|
____ ___ ____ /_ __/ | / ____/
|
|
|
|
/_ / / _ \/ __ \ / / / /| |/ / __
|
|
|
|
/ /_/ __/ / / / / / / ___ / /_/ /
|
|
|
|
/___/\___/_/ /_/ /_/ /_/ |_\____/
|
|
|
|
|
2020-05-23 18:21:57 +02:00
|
|
|
REFRESHing ZenTAG nano DHTs
|
2020-05-23 03:40:03 +02:00
|
|
|
'
|
|
|
|
./zen/ipns_TAG_refresh.sh
|
|
|
|
|
2020-06-06 03:26:58 +02:00
|
|
|
##################################################################
|
2020-05-23 18:21:57 +02:00
|
|
|
if [[ $dayofthemonth == 7 ]]; then
|
|
|
|
availableDiskSize=$(df -P ~/ | awk 'NR>1{sum+=$4}END{print sum}')
|
|
|
|
diskSize="$((availableDiskSize / 2))"
|
|
|
|
ipfs config Datastore.StorageMax $diskSize
|
|
|
|
echo '
|
|
|
|
_____ __ __ ___
|
|
|
|
/ ___// /_____ _________ _____ ____ / |/ /___ __ __
|
|
|
|
\__ \/ __/ __ \/ ___/ __ `/ __ `/ _ \ / /|_/ / __ `/ |/_/
|
|
|
|
___/ / /_/ /_/ / / / /_/ / /_/ / __/ / / / / /_/ /> <
|
|
|
|
/____/\__/\____/_/ \__,_/\__, /\___/ /_/ /_/\__,_/_/|_|
|
|
|
|
/____/
|
2020-05-18 03:58:04 +02:00
|
|
|
# 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.
|
2020-05-13 23:27:29 +02:00
|
|
|
#
|
2020-05-23 18:21:57 +02:00
|
|
|
'
|
|
|
|
echo "StorageMax = $diskSize"
|
2020-05-27 17:44:38 +02:00
|
|
|
|
|
|
|
## RESET ipfs_SWARM_refresh.sh alert
|
|
|
|
rm -f /tmp/ssb-friends_ALERT.txt
|
|
|
|
|
2020-05-23 18:21:57 +02:00
|
|
|
fi
|
2020-06-06 03:26:58 +02:00
|
|
|
##################################################################
|
2020-05-23 18:21:57 +02:00
|
|
|
|
2020-05-18 03:58:04 +02:00
|
|
|
|
2020-05-07 17:34:16 +02:00
|
|
|
fi
|