mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Merge pull request #3535 from Security-Onion-Solutions/fix/cloud-var
Set is_cloud variable in the main shell process
This commit is contained in:
@@ -949,7 +949,7 @@ create_repo() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
detect_cloud() {
|
detect_cloud() {
|
||||||
echo "Testing if setup is running on a cloud instance..." >> "$setup_log" 2>&1
|
echo "Testing if setup is running on a cloud instance..." | tee -a "$setup_log"
|
||||||
if ( curl --fail -s -m 5 http://169.254.169.254/latest/meta-data/instance-id > /dev/null ) || ( dmidecode -s bios-vendor | grep -q Google > /dev/null); then export is_cloud="true"; fi
|
if ( curl --fail -s -m 5 http://169.254.169.254/latest/meta-data/instance-id > /dev/null ) || ( dmidecode -s bios-vendor | grep -q Google > /dev/null); then export is_cloud="true"; fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1942,7 +1942,7 @@ reset_proxy() {
|
|||||||
|
|
||||||
[[ -f /etc/systemd/system/docker.service.d/http-proxy.conf ]] && rm -f /etc/systemd/system/docker.service.d/http-proxy.conf
|
[[ -f /etc/systemd/system/docker.service.d/http-proxy.conf ]] && rm -f /etc/systemd/system/docker.service.d/http-proxy.conf
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
command -v docker &> /dev/null && echo "Restarting Docker..." && systemctl restart docker
|
command -v docker &> /dev/null && echo "Restarting Docker..." | tee -a "$setup_log" && systemctl restart docker
|
||||||
|
|
||||||
[[ -f /root/.docker/config.json ]] && rm -f /root/.docker/config.json
|
[[ -f /root/.docker/config.json ]] && rm -f /root/.docker/config.json
|
||||||
|
|
||||||
|
|||||||
@@ -361,10 +361,10 @@ percentage=0
|
|||||||
echo "Could not install packages required for setup, exiting now." >> "$setup_log" 2>&1
|
echo "Could not install packages required for setup, exiting now." >> "$setup_log" 2>&1
|
||||||
kill -SIGUSR1 "$setup_proc"; exit 1
|
kill -SIGUSR1 "$setup_proc"; exit 1
|
||||||
fi
|
fi
|
||||||
set_progress_str 99 "Detecting whether setup is running in the cloud." nolog
|
|
||||||
detect_cloud
|
|
||||||
} | progress '...'
|
} | progress '...'
|
||||||
|
|
||||||
|
detect_cloud
|
||||||
|
|
||||||
short_name=$(echo "$HOSTNAME" | awk -F. '{print $1}')
|
short_name=$(echo "$HOSTNAME" | awk -F. '{print $1}')
|
||||||
|
|
||||||
MINION_ID=$(echo "${short_name}_${install_type}" | tr '[:upper:]' '[:lower:]')
|
MINION_ID=$(echo "${short_name}_${install_type}" | tr '[:upper:]' '[:lower:]')
|
||||||
|
|||||||
Reference in New Issue
Block a user