feat: Add backup and security hardening
This commit is contained in:
36
scripts/backup-setup/backup-monitor
Normal file
36
scripts/backup-setup/backup-monitor
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/sbin/openrc-run
|
||||
# OpenRC service for backup network trigger
|
||||
# Monitors NAS availability and triggers backups when detected
|
||||
|
||||
name="backup-monitor"
|
||||
description="Backup network trigger service"
|
||||
|
||||
command="/usr/local/bin/backup-trigger"
|
||||
command_background="yes"
|
||||
pidfile="/run/${RC_SVCNAME}.pid"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
use NetworkManager
|
||||
after NetworkManager
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
# Ensure command exists
|
||||
if [ ! -x "$command" ]; then
|
||||
eerror "Backup trigger script not found: $command"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Check config exists
|
||||
if [ ! -f /etc/backup.conf ]; then
|
||||
eerror "Backup configuration not found: /etc/backup.conf"
|
||||
return 1
|
||||
fi
|
||||
|
||||
ebegin "Starting backup monitor"
|
||||
}
|
||||
|
||||
stop_post() {
|
||||
eend $? "Stopped backup monitor"
|
||||
}
|
||||
Reference in New Issue
Block a user