server/configs/nsenter_iptables.sh

20 lines
397 B
Bash
Raw Normal View History

#!/bin/sh
2020-01-30 18:03:14 +00:00
if [ -d /containers/onboot/004-synchro-ip-setup ]; then
LOWER=/containers/onboot/004-synchro-ip-setup/lower
elif [ -d /containers/onboot/004-frontal-ip-setup ]; then
LOWER=/containers/onboot/004-frontal-ip-setup/lower
else
2020-01-30 18:03:14 +00:00
nsenter -t 1 -m -u -i -p -- "$0" $@
exit $?
fi
mount -t tmpfs none $LOWER/run
chroot $LOWER iptables $@
EXIT=$?
umount $LOWER/run
exit ${EXIT}