%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /backups/router/usr/local/etc/rc.syshook.d/backup/
Upload File :
Create Path :
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

Zerion Mini Shell 1.0