Ensure IP is available to child process executing so-allow

This commit is contained in:
Jason Ertel
2020-05-27 22:00:58 -04:00
parent 1e5d5397a4
commit a75301cd0e
2 changed files with 9 additions and 5 deletions

View File

@@ -21,6 +21,8 @@ address_type=DHCP
ADMINUSER=onionuser
ADMINPASS1=onionuser
ADMINPASS2=onionuser
ALLOW_CIDR=192.168.0.0/16
ALLOW_ROLE=a
BASICBRO=7
BASICSURI=7
# BLOGS=
@@ -34,7 +36,6 @@ HNMASTER=10.0.0.0/8,192.168.0.0/16,172.16.0.0/12
HNSENSOR=inherit
HOSTNAME=standalone
install_type=STANDALONE
IP=192.168.0.0/16
# LSINPUTBATCHCOUNT=
# LSINPUTTHREADS=
# LSPIPELINEBATCH=

View File

@@ -33,8 +33,10 @@ while [[ $# -gt 0 ]]; do
export TURBO="http://${arg#*=}";;
"--proxy="* )
export {http,https,ftp,rsync,all}_proxy="${arg#*=}";;
"--allow="* )
export allow="${arg#*=}";;
"--allow-role="* )
export ALLOW_ROLE="${arg#*=}";;
"--allow-cidr="* )
export ALLOW_CIDR="${arg#*=}";;
* )
if [[ "$arg" == "--"* ]]; then
echo "Invalid option"
@@ -556,8 +558,9 @@ fi
success=$(tail -10 $setup_log | grep Failed | awk '{ print $2}')
if [[ "$success" = 0 ]]; then
whiptail_setup_complete
if [[ -n $allow ]]; then
so-allow -$allow >> $setup_log 2>&1
if [[ -n $ALLOW_ROLE && -n $ALLOW_CIDR ]]; then
export IP=$ALLOW_CIDR
so-allow -$ALLOW_ROLE >> $setup_log 2>&1
fi
if [[ $THEHIVE == 1 ]]; then
check_hive_init_then_reboot