server/configs/nsenter_iptables.sh

20 lines
381 B
Bash
Executable File

#!/bin/sh
if [ -d /containers/onboot/004-admin-ip-setup ]; then
LOWER=/containers/onboot/004-admin-ip-setup/lower
elif [ -d /containers/onboot/004-frontal-ip-setup ]; then
LOWER=/containers/onboot/004-frontal-ip-setup/lower
else
nsenter -t 1 -a "$0" $@
exit $?
fi
mount -t tmpfs none $LOWER/run
chroot $LOWER iptables $@
EXIT=$?
umount $LOWER/run
exit ${EXIT}