diff options
author | Renato Botelho <renato@netgate.com> | 2015-08-25 08:08:24 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-08-25 14:49:54 -0300 |
commit | 46bc6e545a17e77202aaf01ec0cd8d5a46567525 (patch) | |
tree | 32d18dda436ec739c67c489ceb771e8629cd926f /src/etc/phpshellsessions/uninstallpkg | |
parent | 4d9801c2dbd2b3e54a39578ee62b93af66607227 (diff) | |
download | pfsense-46bc6e545a17e77202aaf01ec0cd8d5a46567525.zip pfsense-46bc6e545a17e77202aaf01ec0cd8d5a46567525.tar.gz |
Move main pfSense content to src/
Diffstat (limited to 'src/etc/phpshellsessions/uninstallpkg')
-rw-r--r-- | src/etc/phpshellsessions/uninstallpkg | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/etc/phpshellsessions/uninstallpkg b/src/etc/phpshellsessions/uninstallpkg new file mode 100644 index 0000000..9030e56 --- /dev/null +++ b/src/etc/phpshellsessions/uninstallpkg @@ -0,0 +1,34 @@ +require_once("config.inc"); +require_once("util.inc"); +require_once("pkg-utils.inc"); + +global $g, $config, $argv, $command_split; + +if (is_array($command_split)) { + $args = array_slice($command_split, 1); +} else { + $args = array_slice($argv, 2); +} + +$pkg_name = $args[0]; +$pkg_info = array(); + +echo "Removing package \"{$pkg_name}\"...\n"; + +foreach ($config['installedpackages']['package'] as $package) { + if ($pkg_name == $package['name']) { + $pkg_info = $package; + } +} + +$static_output = ""; +$pkg_interface = "console"; + +if (empty($pkg_info)) { + echo "\nPackage not installed.\n"; + return; +} + +uninstall_package($pkg_name); + +echo "\nDone.\n"; |