Process obsolete files in shell script instead of php
This commit is contained in:
parent
48f77cef06
commit
e7a0051400
|
@ -38,3 +38,13 @@ fi;
|
|||
if [ "${PFSENSETYPE}" = "nanobsd" -a -f /etc/localtime ]; then
|
||||
/bin/cp -p /etc/localtime ${ROOT}etc/localtime 2>/dev/null
|
||||
fi
|
||||
|
||||
# Obsolete files - nanobsd doesn't need it since a new image is installed
|
||||
# on the other partition
|
||||
if [ "${PFSENSETYPE}" != "nanobsd" -a -f /etc/pfSense.obsoletedfiles ]; then
|
||||
for f in $(cat /etc/pfSense.obsoletedfiles); do
|
||||
if [ -n "${f}" -a -f "${f}" ]; then
|
||||
rm -f ${f}
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
|
|
@ -24,10 +24,5 @@
|
|||
|
||||
system("echo \"Adding serial port settings ({$newslicedir})...\" >> /conf/upgrade_log.txt");
|
||||
setup_serial_port("upgrade", $newslicedir);
|
||||
|
||||
$files_to_process = file("/etc/pfSense.obsoletedfiles");
|
||||
foreach($files_to_process as $filename)
|
||||
if(file_exists($filename))
|
||||
exec("/bin/rm -f $filename");
|
||||
|
||||
?>
|
||||
|
|
Reference in New Issue