19 lines
559 B
Bash
Executable File
19 lines
559 B
Bash
Executable File
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
CRON_FILE="/etc/cron.d/db-manager"
|
|
CPIF="/usr/local/directadmin/data/admin/custom_package_items.conf"
|
|
if [ "$(id -u)" -eq 0 ]; then
|
|
rm -f "$CRON_FILE"
|
|
if [ -f "$CPIF" ]; then
|
|
sed -i '/^db-manager=/d' "$CPIF" || true
|
|
sed -i '/^db_manager=/d' "$CPIF" || true
|
|
chown diradmin:diradmin "$CPIF" 2>/dev/null || true
|
|
chmod 640 "$CPIF" 2>/dev/null || true
|
|
fi
|
|
else
|
|
echo "db-manager: warning: not running as root, cannot remove cron job or update custom package items" >&2
|
|
fi
|
|
|
|
echo "db-manager: uninstall complete"
|