corrections

This commit is contained in:
qo-op 2021-05-19 15:24:22 +02:00
parent 7262cd68d7
commit 24c5fc60a5
1 changed files with 10 additions and 9 deletions

View File

@ -18,12 +18,6 @@ source $HOME/.profile
[[ ! $(echo $PATH | grep "/usr/games") ]] && export PATH="$PATH:/usr/games"
#### INIT STATION PARAMETERS
isIPFSRunning=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1)
if [[ ! $isIPFSRunning ]]; then
[[ -f /etc/sudoers.d/systemctl ]] && sudo systemctl restart ipfs
echo "ERROR! ipfs daemon is not running. EXIT"
exit 1
fi
[[ $IPFSNODEID ]] && export IPFSNODEID=$IPFSNODEID || export IPFSNODEID=$(ipfs id -f='<id>\n')
########################################################################
@ -33,8 +27,7 @@ fi
########################################################################
### NO IP GATEWAY : EXIT
export LAN=1 && echo "1" > /tmp/LAN
ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` 2>&1>/dev/null && echo "GATEWAY OK" && export LAN=0 && echo "0" > /tmp/LAN
ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` 2>&1>/dev/null && echo "LAN OK" || exit 1
########################################################################
### TEMP CODE (add missing packages to xbian) - TODO REMOVE after 30 mn for git pull & apply
@ -108,7 +101,7 @@ if [[ $(($minute % 15)) == 0 ]]; then
sleep $((1 + RANDOM % 120))
# git reset --hard
git pull
[[ ! $? == 0 ]] && echo "GIT.P2P.LEGAL IS UNREACHABLE"
# if [[ $(diff ~/.zen/astrXbian/.install/.kodi/userdata/addon_data/plugin.video.vstream/settings.xml ~/.kodi/userdata/addon_data/plugin.video.vstream/settings.xml) ]]; then
# cp ~/.zen/astrXbian/.install/.kodi/userdata/addon_data/plugin.video.vstream/settings.xml ~/.kodi/userdata/addon_data/plugin.video.vstream/settings.xml
# echo "MAJ Vstream settings"
@ -119,12 +112,20 @@ if [[ $(($minute % 15)) == 0 ]]; then
[[ -d ~/.zen/ipfs_swarm/astroport ]] && rm -Rf ~/.zen/ipfs_swarm/astroport
[[ -d ~/.zen/ipfs/xbian ]] && rm -Rf ~/.zen/ipfs/xbian
[[ -d ~/.zen/ipfs_swarm/xbian ]] && rm -Rf ~/.zen/ipfs_swarm/xbian
[[ -d ~/.zen/ipfs/PIN ]] && rm -Rf ~/.zen/ipfs/PIN
[[ -d ~/.zen/ipfs_swarm/PIN ]] && rm -Rf ~/.zen/ipfs_swarm/PIN
## CLEANING OLD BAD FILES
rm ~/.zen/ipfs/*
rm ~/.zen/ipfs/.*
rm ~/.zen/ipfs_swarm/*
rm ~/.zen/ipfs_swarm/.*
isIPFSRunning=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1)
if [[ ! $isIPFSRunning ]]; then
[[ -f /etc/sudoers.d/systemctl && $(cat ~/.zen/ipfs/.$IPFSNODEID/.switch) == 1 ]] && sudo systemctl restart ipfs
echo "ERROR! ipfs daemon is not running. EXIT"
exit 1
fi
########## OPEN OR CLOSE SSH ACCESS #################
# [[ "$(ipfs p2p ls | grep $G1PUB-ssh)" == "" ]] && sleep $((1 + RANDOM % 10)) && ~/.zen/astrXbian/zen/ssh_forward2onelove.sh # OPEN-SSH