summaryrefslogtreecommitdiffstats
path: root/usr/local/sbin/WipePackages.php
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2015-03-13 23:28:12 +0545
committerPhil Davis <phil.davis@inf.org>2015-03-13 23:28:12 +0545
commit7d61beba45e06f4be2fc5436f14e879ec7dd2675 (patch)
tree15d21def93d92267bc1be37e0a4b15846ae358c9 /usr/local/sbin/WipePackages.php
parentf2f34088ace895b0113b468b856ceb02301585d1 (diff)
downloadpfsense-7d61beba45e06f4be2fc5436f14e879ec7dd2675.zip
pfsense-7d61beba45e06f4be2fc5436f14e879ec7dd2675.tar.gz
Code Style sbin tmp usr
Bits and pieces from sbin tmp and usr but not yet usr/local/www
Diffstat (limited to 'usr/local/sbin/WipePackages.php')
-rwxr-xr-xusr/local/sbin/WipePackages.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr/local/sbin/WipePackages.php b/usr/local/sbin/WipePackages.php
index d802521..44f24bf 100755
--- a/usr/local/sbin/WipePackages.php
+++ b/usr/local/sbin/WipePackages.php
@@ -30,7 +30,7 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-if(!function_exists("readline")) {
+if (!function_exists("readline")) {
echo "\nThis script requires the readline() libary which is not present on this system.";
echo "\n\nSorry, but we cannot continue.\n";
die("Need readline() library");
@@ -42,23 +42,23 @@ require("config.inc");
echo "\nThis script will wipe all installed packages off of your pfSense installation.\n";
$command = readline("\nAre you sure you would like to continue [y/N]? ");
-if(strtoupper($command) == "Y" || strtoupper($command) == "YES") {
+if (strtoupper($command) == "Y" || strtoupper($command) == "YES") {
$rmconfig = readline("\nWould you like to remove all package configuration information as well [y/N]? ");
echo "\n\nStarting package wipe... One moment please... ";
exec("cd /var/db/pkg/ && find . -exec 'pkg_delete {}' \; ");
exec("rm -rf /var/db/pkg/*");
-
- if(strtoupper($rmconfig) == "Y" || strtoupper($rmconfig) == "YES") {
+
+ if (strtoupper($rmconfig) == "Y" || strtoupper($rmconfig) == "YES") {
echo "\nRemoving pfSense package configuration information...";
- if($config['installedpackages']['package']) {
+ if ($config['installedpackages']['package']) {
unset($config['installedpackages']['package']);
write_config("Package wipe procedure completed.");
}
echo "\n";
}
-
+
echo "\npfSense package wipe procedure has completed.\n\n";
}
OpenPOWER on IntegriCloud