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/installpkg | |
parent | 4d9801c2dbd2b3e54a39578ee62b93af66607227 (diff) | |
download | pfsense-46bc6e545a17e77202aaf01ec0cd8d5a46567525.zip pfsense-46bc6e545a17e77202aaf01ec0cd8d5a46567525.tar.gz |
Move main pfSense content to src/
Diffstat (limited to 'src/etc/phpshellsessions/installpkg')
-rw-r--r-- | src/etc/phpshellsessions/installpkg | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/etc/phpshellsessions/installpkg b/src/etc/phpshellsessions/installpkg new file mode 100644 index 0000000..1ac71bf --- /dev/null +++ b/src/etc/phpshellsessions/installpkg @@ -0,0 +1,36 @@ +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]; + +echo "Installing package \"{$pkg_name}\"...\n"; + +echo "Trying to fetch package info..."; +$pkg_info = get_pkg_info(); +if ($pkg_info) { + echo " Done.\n"; +} else { + echo "\n" . gettext(' >>> Unable to get pkg info.') . "\n"; + return; +} + +$static_output = ""; +$pkg_interface = "console"; + +if (empty($pkg_info[$pkg_name])) { + echo "\nPackage not found.\n"; + return; +} + +install_package($pkg_name); + +echo "\nDone.\n"; |