mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
simplify cloud detection
This commit is contained in:
@@ -1124,9 +1124,8 @@ create_repo() {
|
|||||||
|
|
||||||
detect_cloud() {
|
detect_cloud() {
|
||||||
echo "Testing if setup is running on a cloud instance..." | tee -a "$setup_log"
|
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 ) || \
|
if dmidecode -s bios-version | grep -q amazon || \
|
||||||
( curl --fail -s -m 5 -H "X-aws-ec2-metadata-token: $(curl -s -X PUT 'http://169.254.169.254/latest/api/token' -H 'X-aws-ec2-metadata-token-ttl-seconds: 30')" http://169.254.169.254/latest/meta-data/instance-id > /dev/null) || \
|
dmidecode -s bios-vendor | grep -q Google || \
|
||||||
(dmidecode -s bios-vendor | grep -q Google > /dev/null) || \
|
|
||||||
[ -f /var/log/waagent.log ]; then
|
[ -f /var/log/waagent.log ]; then
|
||||||
|
|
||||||
echo "Detected a cloud installation." | tee -a "$setup_log"
|
echo "Detected a cloud installation." | tee -a "$setup_log"
|
||||||
|
|||||||
Reference in New Issue
Block a user