pve-trunks-plugin/uninstall.sh

25 lines
534 B
Bash
Executable File

#!/bin/bash
# PVE Trunks Plugin - Uninstaller
set -e
PVE_JS_DIR="/usr/share/pve-manager/js"
INDEX_TPL="/usr/share/pve-manager/index.html.tpl"
PLUGIN_JS="pve-trunks-plugin.js"
if [ "$(id -u)" -ne 0 ]; then
echo "Error: run as root"
exit 1
fi
# Remove plugin JS
rm -f "$PVE_JS_DIR/$PLUGIN_JS"
echo "Removed $PVE_JS_DIR/$PLUGIN_JS"
# Remove script tag from index template
sed -i '/pve-trunks-plugin/d' "$INDEX_TPL"
echo "Cleaned $INDEX_TPL"
systemctl restart pveproxy
echo "Done. Reload the Proxmox web UI (Ctrl+Shift+R)."