astroport/.install/ipfs/uninstall

34 lines
881 B
Bash
Executable File

#!/usr/bin/env bash
set -e
# Remove script and service for ipfs bootstrap
sudo rm -r /usr/local/bin/ipfs-swarm.sh || true
# Uninstall dependencies
sudo apt-get remove -y jq
# Uninstall IPFS
sudo systemctl disable ipfs.service 2>/dev/null || true
sudo systemctl stop ipfs.service 2>/dev/null || true
sudo systemctl daemon-reload
sudo rm -f /usr/local/bin/ipfs
sudo rm -f /etc/systemd/system/ipfs.service
if [ -d "$HOME/.ipfs" ]; then
echo "Found ~/.ipfs"
read -p "Keep your IPFS data (Y/n)? " -n 1 -r
echo ""
if [[ $REPLY =~ ^[Nn]$ ]]; then
echo -e "\e[1;31mRemoving ~/.ipfs\e[0m"
sudo rm -rf ~/.ipfs
else
echo -e "\e[1;32mKeeping ~/.ipfs\e[0m"
fi
fi
# Remove HTTP to IPFS gateway
sudo rm -f /etc/nginx/sites-enabled/ipfs-http-gateway
sudo rm -f /etc/nginx/sites-available/ipfs-http-gateway
sudo systemctl restart nginx.service