22 lines
569 B
Bash
Executable File
22 lines
569 B
Bash
Executable File
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
PLUGIN_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
|
|
|
# Safety checks to avoid deleting the wrong path.
|
|
if [ "$(basename "$PLUGIN_DIR")" != "borg-restore" ]; then
|
|
echo "borg-restore: safety check failed (basename is not borg-restore): $PLUGIN_DIR" >&2
|
|
exit 1
|
|
fi
|
|
if [ ! -f "$PLUGIN_DIR/plugin.conf" ]; then
|
|
echo "borg-restore: safety check failed (plugin.conf missing): $PLUGIN_DIR" >&2
|
|
exit 1
|
|
fi
|
|
|
|
CRON_FILE="/etc/cron.d/borg-restore"
|
|
if [ -f "$CRON_FILE" ]; then
|
|
rm -f "$CRON_FILE" || true
|
|
fi
|
|
|
|
echo "borg-restore: uninstall complete"
|