Files
venus/mfd-custom-app/uninstall.sh
dev 9756538f16 Initial commit: Venus OS boat addons monorepo
Organizes 11 projects for Cerbo GX/Venus OS into a single repository:
- axiom-nmea: Raymarine LightHouse protocol decoder
- dbus-generator-ramp: Generator current ramp controller
- dbus-lightning: Blitzortung lightning monitor
- dbus-meteoblue-forecast: Meteoblue weather forecast
- dbus-no-foreign-land: noforeignland.com tracking
- dbus-tides: Tide prediction from depth + harmonics
- dbus-vrm-history: VRM cloud history proxy
- dbus-windy-station: Windy.com weather upload
- mfd-custom-app: MFD app deployment package
- venus-html5-app: Custom Victron HTML5 app fork
- watermaker: Watermaker PLC control UI

Adds root README, .gitignore, project template, and per-project
.gitignore files. Sensitive config files excluded via .gitignore
with .example templates provided.

Made-with: Cursor
2026-03-16 17:04:16 +00:00

79 lines
2.2 KiB
Bash
Executable File

#!/bin/bash
#
# Uninstall Custom MFD App for Venus OS
#
# Removes the custom HTML5 app override, restoring the default Victron app.
#
# Usage:
# ./uninstall.sh
set -e
INSTALL_DIR="/data/www/app"
BACKUP_DIR="/data/www/app.backup"
PERSIST_DIR="/data/mfd-custom-app"
RC_LOCAL="/data/rc.local"
echo "=================================================="
echo "Custom MFD App - Uninstall"
echo "=================================================="
echo "1. Removing custom app..."
if [ -d "$INSTALL_DIR" ]; then
rm -rf "$INSTALL_DIR"
echo " Removed $INSTALL_DIR"
else
echo " Not installed"
fi
echo "2. Removing nginx override..."
NGINX_CONF=$(ls /run/nginx/sites-enabled/* 2>/dev/null | head -n 1)
if [ -n "$NGINX_CONF" ] && grep -q "mfd-custom-app-override" "$NGINX_CONF"; then
sed -i '/mfd-custom-app-override/d' "$NGINX_CONF"
sed -i '/location \^~ \/app\/ { root \/data\/www/d' "$NGINX_CONF"
sed -i '/location \^~ \/default\/app\//d' "$NGINX_CONF"
nginx -s reload 2>/dev/null || true
echo " Nginx override removed"
else
echo " No nginx override found"
fi
echo "3. Restoring backup (if available)..."
if [ -d "$BACKUP_DIR" ]; then
mv "$BACKUP_DIR" "$INSTALL_DIR"
echo " Restored from backup"
else
echo " No backup to restore. Default Victron app will be used."
fi
echo "4. Cleaning up rc.local..."
if [ -f "$RC_LOCAL" ]; then
if grep -q "# BEGIN mfd-custom-app" "$RC_LOCAL"; then
sed -i '/# BEGIN mfd-custom-app/,/# END mfd-custom-app/d' "$RC_LOCAL"
else
TEMP_RC=$(mktemp)
grep -v "mfd-custom-app" "$RC_LOCAL" | grep -v "# Custom MFD App" > "$TEMP_RC" || true
mv "$TEMP_RC" "$RC_LOCAL"
fi
chmod +x "$RC_LOCAL"
echo " Cleaned rc.local"
else
echo " No rc.local found"
fi
echo "5. Removing persistent copy..."
if [ -d "$PERSIST_DIR" ]; then
rm -rf "$PERSIST_DIR"
echo " Removed $PERSIST_DIR"
else
echo " No persistent copy found"
fi
echo ""
echo "=================================================="
echo "Uninstall complete!"
echo "=================================================="
echo ""
echo "The default Victron app is restored at: http://CERBO_IP/app/"
echo ""