From 03c830bea494dfa34d5f8fe5b3814c8efe164aee Mon Sep 17 00:00:00 2001 From: Christer Edwards Date: Sat, 31 Jul 2021 19:47:01 -0600 Subject: [PATCH] basic PKG support for ubuntu/debian containers --- usr/local/share/bastille/pkg.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/usr/local/share/bastille/pkg.sh b/usr/local/share/bastille/pkg.sh index 4df3efc9..66bc3cff 100644 --- a/usr/local/share/bastille/pkg.sh +++ b/usr/local/share/bastille/pkg.sh @@ -47,10 +47,13 @@ fi for _jail in ${JAILS}; do info "[${_jail}]:" - if [ -f "/usr/sbin/pkg" ]; then - jexec -l "${_jail}" /usr/sbin/pkg "$@" + bastille_jail_path=$(jls -j "${_jail}" path) + if [ -f "/usr/sbin/mport" ]; then + jexec -l -U root "${_jail}" /usr/sbin/mport "$@" + elif [ -f "${bastille_jail_path}/usr/bin/apt" ]; then + jexec -l "${_jail}" /usr/bin/apt "$@" else - jexec -l "${_jail}" /usr/sbin/mport "$@" + jexec -l -U root "${_jail}" /usr/sbin/pkg "$@" fi echo done