mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 08:09:41 +00:00
backup: remove unused env var and add netflow script
This commit is contained in:
parent
84416c7187
commit
ce4bb4e7a6
@ -2125,8 +2125,7 @@ function upgrade_054_to_055()
|
||||
enable_rrd_graphing();
|
||||
/* Let's save the RRD graphs after we run enable RRD graphing */
|
||||
/* The function will restore the rrd.tgz so we will save it after */
|
||||
exec("cd /; LANG=C NO_REMOUNT=1 RRDDBPATH='{$rrddbpath}' CF_CONF_PATH='/conf' /usr/local/etc/rc.backup_rrd");
|
||||
mwexec('/bin/rm /var/db/rrd/*.xml');
|
||||
exec("cd /; LANG=C RRDDBPATH='{$rrddbpath}' CF_CONF_PATH='/conf' /usr/local/etc/rc.backup_rrd");
|
||||
if (file_exists("/var/run/booting")) {
|
||||
echo "Updating configuration...";
|
||||
}
|
||||
@ -2790,7 +2789,7 @@ function upgrade_080_to_081()
|
||||
enable_rrd_graphing();
|
||||
/* Let's save the RRD graphs after we run enable RRD graphing */
|
||||
/* The function will restore the rrd.tgz so we will save it after */
|
||||
exec("cd /; LANG=C NO_REMOUNT=1 RRDDBPATH='{$rrddbpath}' CF_CONF_PATH='/conf' /usr/local/etc/rc.backup_rrd");
|
||||
exec("cd /; LANG=C RRDDBPATH='{$rrddbpath}' CF_CONF_PATH='/conf' /usr/local/etc/rc.backup_rrd");
|
||||
if (file_exists("/var/run/booting"))
|
||||
echo "Updating configuration...";
|
||||
foreach($config['filter']['rule'] as & $rule) {
|
||||
@ -3096,7 +3095,7 @@ function upgrade_095_to_096()
|
||||
enable_rrd_graphing();
|
||||
/* Let's save the RRD graphs after we run enable RRD graphing */
|
||||
/* The function will restore the rrd.tgz so we will save it after */
|
||||
exec("cd /; LANG=C NO_REMOUNT=1 RRDDBPATH='{$rrddbpath}' CF_CONF_PATH='/conf' /usr/local/etc/rc.backup_rrd");
|
||||
exec("cd /; LANG=C RRDDBPATH='{$rrddbpath}' CF_CONF_PATH='/conf' /usr/local/etc/rc.backup_rrd");
|
||||
}
|
||||
|
||||
function upgrade_096_to_097()
|
||||
|
||||
@ -184,6 +184,9 @@ echo "done."
|
||||
# Execute the early syshook / plugin commands
|
||||
/usr/local/etc/rc.syshook early
|
||||
|
||||
# Restore backups from previous shutdown (if any)
|
||||
/usr/local/etc/rc.backup_netflow restore
|
||||
|
||||
# let the PHP-based configuration subsystem set up the system now
|
||||
echo -n "Launching the init system..."
|
||||
rm -f /root/lighttpd*
|
||||
|
||||
14
src/etc/rc.backup_netflow
Executable file
14
src/etc/rc.backup_netflow
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
BACKUPFILE="/conf/netflow.tgz"
|
||||
BACKUPDIR="/var/netflow"
|
||||
|
||||
if [ "${1}" == "restore" ]; then
|
||||
if [ -f "${BACKUPFILE}" ]; then
|
||||
tar -C / -xzf "${BACKUPFILE}"
|
||||
fi
|
||||
else
|
||||
if [ -d "${BACKUPDIR}" ]; then
|
||||
tar -C / -czf "${BACKUPFILE}" "${BACKUPDIR}"
|
||||
fi
|
||||
fi
|
||||
@ -11,6 +11,7 @@
|
||||
|
||||
# backup volatile internals
|
||||
/usr/local/etc/rc.backup_dhcpleases
|
||||
/usr/local/etc/rc.backup_netflow
|
||||
/usr/local/etc/rc.backup_rrd
|
||||
|
||||
# wait for config lock to release
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user