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 06ded54 commit 8153b1eCopy full SHA for 8153b1e
skeleton-common/usr/local/bin/scw-metadata
@@ -8,6 +8,18 @@ CACHE_FILE=/run/scw-metadata.cache
8
METADATA_IP=${METADATA_IP:-169.254.42.42}
9
METADATA_URL=${METADATA_URL:-"http://${METADATA_IP}/conf"}
10
11
+if [ "$1" = -h ] || [ "$1" = --help ]; then
12
+ cat <<EOF
13
+Usage: $0 [--cached] [KEY]
14
+Retrieves metadata about this server (All available metadata by default).
15
+ --cached Use the previously fetched metadata if available.
16
+
17
+$0 outputs the value of the key if given, or a newline separated list of KEY=value couples otherwise.
18
+The value might be an empty string.
19
+EOF
20
+ exit 0
21
+fi
22
23
if [ "$1" = "--cached" -a -f $CACHE_FILE ]; then
24
shift
25
BODY=$(cat $CACHE_FILE)
0 commit comments