ssb-server control & restart
This commit is contained in:
parent
16d6594825
commit
1dbee81e86
|
@ -17,13 +17,21 @@ ME="${0##*/}"
|
||||||
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"
|
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"
|
||||||
source /home/$YOU/.profile
|
source /home/$YOU/.profile
|
||||||
export IPFSNODEID=$(ipfs id -f='<id>\n') || er+=" ipfs id problem"
|
export IPFSNODEID=$(ipfs id -f='<id>\n') || er+=" ipfs id problem"
|
||||||
export WHOAMI=$($MY_PATH/zen/tools/timeout.sh -t 5 sbotc whoami | jq -r .id)
|
export WHOAMI=$($MY_PATH/zen/tools/timeout.sh -t 8 sbotc whoami | jq -r .id)
|
||||||
|
|
||||||
if [[ "$WHOAMI" == "" ]]; then
|
if [[ "$WHOAMI" == "" ]]; then
|
||||||
### oasis ssb-server not responding!!!
|
### oasis ssb-server not responding!!!
|
||||||
echo "sboc <-> SSB-SERVER IMPOSSIBLE..."
|
echo "sbotc <-> ssb-server communication broken... restarting ssb-server !"
|
||||||
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
|
ssb_process=$(ps auxf --sort=+utime | grep -w 'ssb-server' | grep -v -E 'color=auto|grep' | tail -n 1 | awk '{print $2}')
|
||||||
|
kill -9 $ssb_process
|
||||||
|
|
||||||
|
sleep 5
|
||||||
|
ssb_newprocess=$(ps auxf --sort=+utime | grep -w 'ssb-server' | grep -v -E 'color=auto|grep' | tail -n 1 | awk '{print $2}')
|
||||||
|
|
||||||
|
if [[ ! $ssb_newprocess ]]; then
|
||||||
|
while true; do ssb-server start; sleep 3; done &
|
||||||
|
fi
|
||||||
|
|
||||||
# kill -9 $(ps auxf --sort=+utime | grep -w 'oasis' | grep -v -E 'color=auto|grep' | tail -n 1 | awk '{print $2}')
|
# 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 &
|
# oasis --allow-host oasis.astroport.com --host oasis.astroport.com &
|
||||||
|
|
Loading…
Reference in New Issue