diff --git a/20h12.process.sh b/20h12.process.sh index 2ddf9aa5..3aae45a6 100755 --- a/20h12.process.sh +++ b/20h12.process.sh @@ -14,8 +14,13 @@ espeak "Ding" > /dev/null 2>&1 rm -Rf ~/.zen/tmp/* ## RESTART IPFS DAEMON +STOPPED=$(sudo systemctl status ipfs | grep disabled) ## IPFS DISABLED - START ONLY FOR SYNC - # 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 +if [[ $STOPPED != "" ]]; then + sudo systemctl start ipfs && sleep 10 +else + sudo systemctl restart ipfs && sleep 10 +fi espeak "CODE git pull" > /dev/null 2>&1 @@ -81,4 +86,7 @@ else echo "systemd restart" fi +## IPFS DISABLED : STOP IT +[[ $STOPPED != "" ]] && sleep 360 && sudo systemctl stop ipfs + exit 0 diff --git a/install.sh b/install.sh index cfdd1e98..ec223145 100755 --- a/install.sh +++ b/install.sh @@ -218,7 +218,7 @@ echo "#############################################" espeak "Please create a player" [[ $XDG_SESSION_TYPE == 'x11' ]] \ && xdg-open "http://astroport.localhost:1234" \ - || ~/.zen/Astroport.ONE/comand.sh + || ~/.zen/Astroport.ONE/command.sh else diff --git a/tools/cron_VRFY.sh b/tools/cron_VRFY.sh index 24054e09..f168141c 100755 --- a/tools/cron_VRFY.sh +++ b/tools/cron_VRFY.sh @@ -33,17 +33,19 @@ cat ~/.zen/GPS 2>/dev/null && echo " TODO calibrate 20H12 with GPS" if [[ ! $crontest ]]; then ## HEADER - [[ $1 == "OFF" ]] && exit 0 + [[ $1 == "OFF" || ]] && exit 0 [[ ! $(cat /tmp/mycron | grep -F 'SHELL') ]] && echo "SHELL=/bin/bash" > /tmp/newcron [[ ! $(cat /tmp/mycron | grep -F 'PATH') ]] && echo "PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" >> /tmp/newcron cat /tmp/mycron >> /tmp/newcron # ADD 20h12.process.sh line echo "12 20 * * * /bin/bash $MY_PATH/../20h12.process.sh > /tmp/20h12.log 2>&1" >> /tmp/newcron crontab /tmp/newcron - sudo systemctl enable ipfs + [[ $1 != "LOW" ]] && sudo systemctl enable ipfs sudo systemctl enable astroport - sudo systemctl start ipfs + sudo systemctl enable g1billet + [[ $1 != "LOW" ]] && sudo systemctl start ipfs sudo systemctl start astroport + sudo systemctl start g1billet echo "ASTROPORT is ON" else @@ -56,9 +58,20 @@ else crontab /tmp/newcron sudo systemctl stop ipfs sudo systemctl disable ipfs - sudo systemctl stop astroport - sudo systemctl disable astroport - echo "ASTROPORT is OFF" + echo "ASTROPORT IPFS is OFF (20H12 START ONLY)" + + if [[ $1 == "LOW" ]]; then + echo "KEEPING 20H12 CRON ACTIVATED" + ## LOW DISK RESSOURCES IPFS MODE + [[ ! $(cat /tmp/mycron | grep -F 'SHELL') ]] && echo "SHELL=/bin/bash" > /tmp/newcron + [[ ! $(cat /tmp/mycron | grep -F 'PATH') ]] && echo "PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" >> /tmp/newcron + cat /tmp/mycron >> /tmp/newcron + # ADD 20h12.process.sh line + echo "12 20 * * * /bin/bash $MY_PATH/../20h12.process.sh > /tmp/20h12.log 2>&1" >> /tmp/newcron + crontab /tmp/newcron + + fi + fi