2021-05-06 04:14:05 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -x
|
|
|
|
#set -e
|
|
|
|
|
|
|
|
source /usr/share/mynode/mynode_config.sh
|
|
|
|
source /usr/share/mynode/mynode_app_versions.sh
|
|
|
|
|
|
|
|
# Make sure we have an app argument
|
|
|
|
if [ "$#" -ne 1 ]; then
|
2021-05-08 19:54:20 +00:00
|
|
|
echo "Usage: mynode_uninstall_app.sh <app_name>"
|
2021-05-06 04:14:05 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
APP="$1"
|
|
|
|
|
|
|
|
|
|
|
|
# Delete the app's version file and install file
|
|
|
|
rm -f /home/bitcoin/.mynode/${APP}_version || true
|
|
|
|
rm -f /mnt/hdd/mynode/settings/${APP}_version || true
|
|
|
|
rm -f /home/bitcoin/.mynode/install_${APP} || true
|
|
|
|
rm -f /mnt/hdd/mynode/settings/install_${APP} || true
|
|
|
|
sync
|
|
|
|
|
|
|
|
# Custom uninstall steps
|
2021-05-18 01:41:26 +00:00
|
|
|
if [ "$APP" = "bos" ]; then
|
|
|
|
npm uninstall -g balanceofsatoshis
|
2021-06-25 05:47:14 +00:00
|
|
|
elif [ "$APP" = "btcpayserver" ]; then
|
|
|
|
. "/opt/mynode/btcpayserver/btcpay-env.sh" && cd "$BTCPAY_BASE_DIRECTORY" && . helpers.sh && btcpay_remove
|
|
|
|
cd ~
|
2021-05-18 01:41:26 +00:00
|
|
|
elif [ "$APP" = "btcrpcexplorer" ]; then
|
2021-05-06 04:14:05 +00:00
|
|
|
rm -rf /opt/mynode/btc-rpc-explorer
|
2021-05-18 01:56:17 +00:00
|
|
|
elif [ "$APP" = "dojo" ]; then
|
|
|
|
rm -f /mnt/hdd/mynode/settings/dojo_url
|
|
|
|
rm -f /mnt/hdd/mynode/settings/mynode_dojo_install
|
|
|
|
cd /mnt/hdd/mynode/dojo/docker/my-dojo/
|
|
|
|
|
|
|
|
# Stop and uninstall
|
|
|
|
yes | ./dojo.sh uninstall
|
|
|
|
|
|
|
|
# Reset config files
|
|
|
|
cd ~
|
|
|
|
rm -rf /opt/download/dojo
|
|
|
|
rm -rf /mnt/hdd/mynode/dojo
|
2021-09-25 17:23:15 +00:00
|
|
|
elif [ "$APP" = "joininbox" ]; then
|
|
|
|
rm -rf /home/joinmarket/*
|
|
|
|
rm -rf /home/joinmarket/joininbox-*
|
|
|
|
rm -rf /home/joinmarket/.cache
|
2021-05-06 04:14:05 +00:00
|
|
|
elif [ "$APP" = "lndhub" ]; then
|
|
|
|
rm -rf /opt/mynode/LndHub
|
|
|
|
elif [ "$APP" = "rtl" ]; then
|
2021-05-18 01:41:26 +00:00
|
|
|
rm -rf /opt/mynode/RTL
|
2021-05-06 04:14:05 +00:00
|
|
|
else
|
|
|
|
echo "No custom uninstall steps"
|
|
|
|
fi
|
|
|
|
|
2021-06-25 05:47:14 +00:00
|
|
|
# Attempt generic uninstall
|
|
|
|
rm -rf /opt/mynode/${APP}
|
|
|
|
|
2021-05-06 04:14:05 +00:00
|
|
|
|
|
|
|
chown -R admin:admin /home/admin/upgrade_logs
|
|
|
|
sync
|