We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 76a69d3 commit 62da9c3Copy full SHA for 62da9c3
mkosi.profiles/gcp/mkosi.extra/usr/bin/set-hostname.sh
@@ -1,5 +1,10 @@
1
#!/bin/bash
2
3
+if ! which curl; then
4
+ echo "curl is not present on system, exiting..."
5
+ exit 0
6
+fi
7
+
8
while true; do
9
if hostname=$(
10
curl --header "Metadata-Flavor: Google" --silent --show-error \
@@ -10,6 +15,8 @@ while true; do
15
echo 127.0.0.1 "${hostname}" >> /etc/hosts
11
16
systemctl restart rsyslog
12
17
exit 0
18
+ else
19
+ echo "Failed to query metadata service, will retry in 1s"
13
20
fi
14
21
22
sleep 1
0 commit comments