restart ipfs if not running

This commit is contained in:
qo-op 2021-05-19 14:11:31 +02:00
parent f637cabecc
commit 194790b3bf
1 changed files with 5 additions and 1 deletions

View File

@ -19,7 +19,11 @@ rm -f ~/.zen/A_swarm_map.txt && touch ~/.zen/A_swarm_map.txt
# ENVIRONEMENT DETECTION + IPFS ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_info
########################################################################
isIPFSRunning=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1)
[[ ! $isIPFSRunning ]] && echo "ERROR! ipfs daemon is not running. EXIT" && exit 1
if [[ ! $isIPFSRunning ]]; then
[[ -f /etc/sudoers.d/systemctl ]] && sudo systemctl restart ipfs
echo "ERROR! ipfs daemon is not running. EXIT"
exit 1
fi
########################################################################
# Force Strict #swarm0 !!?