Improved jail IP search during import

This commit is contained in:
Jose
2019-12-19 00:58:02 -04:00
parent 62b95711e7
commit 37cc1ea1b0
3 changed files with 3 additions and 2 deletions

View File

@@ -927,7 +927,7 @@ jail_import()
# Get some jail info.
NAME_TRIM=$(echo ${TARGET} | awk '{print $1}' | grep -o '[^/]*$' | cut -d '-' -f1)
PATH_TRIM=$(echo ${TARGET} | sed "s/${NAME_TRIM}//g")
IPV4_ADDR=$(cat ${PATH_TRIM}conf/thebrig.conf | grep -wE "${NAME_TRIM}1|ip4.addr" | tail -n 1 | cut -d '|' -f2 | cut -d '/' -f1)
IPV4_ADDR=$(cat ${PATH_TRIM}conf/thebrig.conf | awk "/${NAME_TRIM}/,/ip4.addr/" | tail -n 1 | cut -d '|' -f2 | cut -d '/' -f1)
if [ -z "${IPV4_ADDR}" ]; then
# The user should manually set a new IP.
IPV4_ADDR="0.0.0.0"