mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
35 lines
641 B
Plaintext
35 lines
641 B
Plaintext
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";
|