summaryrefslogtreecommitdiffstats
path: root/etc/rc.initial.store_config_to_removable_device
diff options
context:
space:
mode:
authorErmal LUÇI <eri@pfsense.org>2014-12-02 11:28:37 +0100
committerErmal LUÇI <eri@pfsense.org>2014-12-02 11:28:37 +0100
commit8ad1ee636afe18a52b717db6b7112b26b7ebeed9 (patch)
tree07c175f530ff058afb9697e5f022c41d5a7a0983 /etc/rc.initial.store_config_to_removable_device
parent2eb3efc20a504c48b66546b4d6b9c9f837555638 (diff)
downloadpfsense-8ad1ee636afe18a52b717db6b7112b26b7ebeed9.zip
pfsense-8ad1ee636afe18a52b717db6b7112b26b7ebeed9.tar.gz
Remove exit and also properly close open files
Diffstat (limited to 'etc/rc.initial.store_config_to_removable_device')
-rwxr-xr-xetc/rc.initial.store_config_to_removable_device9
1 files changed, 6 insertions, 3 deletions
diff --git a/etc/rc.initial.store_config_to_removable_device b/etc/rc.initial.store_config_to_removable_device
index 19fa70e..e7d3bdd 100755
--- a/etc/rc.initial.store_config_to_removable_device
+++ b/etc/rc.initial.store_config_to_removable_device
@@ -42,7 +42,8 @@
$dirs = return_dir_as_array("/var/db/pfi/");
if(!is_array($dirs)) {
echo "\nNo capable storage devices detected.\n";
- exit;
+ fclose($fp);
+ return;
}
echo "\nDevices capable of config.xml storage:\n";
foreach($dirs as $dir) {
@@ -55,7 +56,8 @@
echo "{$g['product_name']} configuration file to reside on: ";
$move_config_to_device = chop(fgets($fp));
if ($move_config_to_device == "") {
- exit(0);
+ fclose($fp);
+ return 0;
}
} while (!$move_config_to_device);
@@ -64,7 +66,8 @@
$status = mwexec("/sbin/mount -w -t msdosfs /dev/{$move_config_to_device} /tmp/mnt/cf");
if(!$status) {
echo "Error while mounting {$move_config_to_device}.\n";
- exit;
+ fclose($fp);
+ return;
}
echo "\n\nProcessing: ";
OpenPOWER on IntegriCloud