astroport/reset_keys/reset_ipfs.sh

13 lines
294 B
Bash

#!/bin/bash
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
sudo systemctl stop ipfs
shopt -s extglob
cd /home/$YOU || exit 1
rm -rf .ipfs/
[[ -d .zen ]] && cd .zen || exit 1
[[ $(echo "${PWD##*/}") == .zen ]] && rm -rf !(astroport)