mirror of
https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud.git
synced 2025-12-15 11:22:43 +03:00
Use grep -E instead of egrep
This commit is contained in:
parent
2713aac43f
commit
e402fe63e7
@ -15,7 +15,7 @@ _imds_header() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_imds_ssh_keys() {
|
_imds_ssh_keys() {
|
||||||
_imds "$IMDS_SSH_KEYS" | sed 's/"/\n/g' | egrep -v '(\[|\]|,)' | sort -u
|
_imds "$IMDS_SSH_KEYS" | sed 's/"/\n/g' | grep -E -v '(\[|\]|,)' | sort -u
|
||||||
}
|
}
|
||||||
|
|
||||||
_imds_userdata() {
|
_imds_userdata() {
|
||||||
|
|||||||
@ -10,7 +10,7 @@ IMDS_LOCAL_HOSTNAME="$IMDS_HOSTNAME"
|
|||||||
IMDS_SSH_KEYS="SSH_PUBLIC_KEYS_[0-9]+_KEY"
|
IMDS_SSH_KEYS="SSH_PUBLIC_KEYS_[0-9]+_KEY"
|
||||||
|
|
||||||
_imds() {
|
_imds() {
|
||||||
wget --quiet --timeout 1 --output-document - "http://$IMDS_ENDPOINT/$IMDS_URI$IMDS_QUERY" | egrep "^${1}=" | cut -d'=' -f2
|
wget --quiet --timeout 1 --output-document - "http://$IMDS_ENDPOINT/$IMDS_URI$IMDS_QUERY" | grep -E "^${1}=" | cut -d'=' -f2
|
||||||
}
|
}
|
||||||
|
|
||||||
_imds_ssh_keys() {
|
_imds_ssh_keys() {
|
||||||
|
|||||||
@ -106,8 +106,9 @@ imds_local_hostname_oci_body() { check_local_hostname oci; }
|
|||||||
imds_local_hostname_scaleway_body() {
|
imds_local_hostname_scaleway_body() {
|
||||||
fake_metadata scaleway <<-EOF
|
fake_metadata scaleway <<-EOF
|
||||||
HOSTNAME=myhostname
|
HOSTNAME=myhostname
|
||||||
|
FOO=bar
|
||||||
EOF
|
EOF
|
||||||
CLOUD="scaleway" atf_check -o match:"myhostname" imds @local-hostname
|
CLOUD="scaleway" atf_check -o match:"^myhostname$" imds @local-hostname
|
||||||
}
|
}
|
||||||
imds_local_hostname_hetzner_body() { check_local_hostname hetzner; }
|
imds_local_hostname_hetzner_body() { check_local_hostname hetzner; }
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user