Compare commits

..

No commits in common. "920b2ba704aafa43237851232a5f58678dfcfd36" and "61f8fed14afa73ee9893b998ec6149ad0ed9188e" have entirely different histories.

1 changed files with 2 additions and 15 deletions

View File

@ -14,11 +14,7 @@ MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
countMErunning=$(ps auxf --sort=+utime | grep -w "$ME" | grep -v -E 'color=auto|grep' | wc -l)
[[ $countMErunning -gt 2 ]] && \
echo "$ME already running. Killing old process" && \
mekill=$(ps auxf --sort=+utime | grep -w "$ME" | grep -v -E 'color=auto|grep' | head -n 1 | awk '{ print $2 }') && \
kill -9 $mekill && \
exit 0
[[ $countMErunning -gt 2 ]] && echo "$ME already running. EXIT." && exit 0
TS=$(date -u +%s%N | cut -b1-13)
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
@ -27,16 +23,7 @@ MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) || echo " warning ipfs daemon not running"
isLAN=$(hostname -I | awk '{print $1}' | head -n 1 | cut -f3 -d '/' | grep -E "(^127\.)|(^192\.168\.)|(^fd42\:)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/")
IPFSNODEID=$(ipfs id --timeout=1s | jq -r .ID)
howmany=$(cat /tmp/ipfsbunk.timeout)
if [[ ! $IPFSNODEID ]]; then
## wait a howmany timeout before restarting ipfs
howmany=$((howmany + 1)) && echo $howmany > /tmp/ipfsbunk.timeout
[ $howmany -gt 3 ] && [[ -f /etc/sudoers.d/systemctl ]] && echo "IPFS NOT RUNNING $(date)" && rm /tmp/ipfsbunk.timeout && sudo systemctl stop ipfs && rm /config/ipfs/repo.lock && sudo systemctl start ipfs
exit 1
else
echo 0 > /tmp/ipfsbunk.timeout
fi
IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID)
IPFSNGW="https://tube.copylaradio.com"
IPFSNGW="http://127.0.0.1:8080"