Skip to content

Instantly share code, notes, and snippets.

@bimalm
Created February 20, 2023 14:08
Show Gist options
  • Save bimalm/13113904a833c139f610f2ccfce60965 to your computer and use it in GitHub Desktop.
Save bimalm/13113904a833c139f610f2ccfce60965 to your computer and use it in GitHub Desktop.
nc -w 3 $1 $2 >/dev/null
if [ $? -ne 0 ]
then
echo "/ip4/$1/tcp/$2"
fi
miner1 peer session|grep ip4|awk -F "/" '{ print "./check.sh " $7 " " $9 "&"}'|sed 's/|//g' >a.sh
for i in $(bash a.sh|grep ip4)
do
echo $i
miner1 peer disconnect $i
done
set execution permission for check.sh
chmod +x check.sh
Run below in a screen session :
while [ 1 ]; do bash cleanup.sh; sleep 70 ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment