%PDF- %PDF-
Direktori : /backups/router/usr/local/etc/rc.syshook.d/backup/ |
Current File : //backups/router/usr/local/etc/rc.syshook.d/backup/20-dhcpleases |
#!/bin/sh BACKUPDIR="/var/dhcpd/var/db" BACKUPFILE="/conf/dhcpleases.tgz" BACKUPOFF="<dhcpbackup>-1</dhcpbackup>" if [ "$(grep -c "${BACKUPOFF}" /conf/config.xml)" != "0" ]; then rm -f ${BACKUPFILE} elif [ "${1}" = "restore" ]; then if [ -f "${BACKUPFILE}" ]; then tar -C / -xzpf "${BACKUPFILE}" fi else if [ -d "${BACKUPDIR}" ]; then tar -C / -czf "${BACKUPFILE}" ."${BACKUPDIR}" fi fi