Skip to content

Commit ffa13f4

Browse files
committed
scw-metadata: add --help
1 parent 06ded54 commit ffa13f4

File tree

4 files changed

+12
-23
lines changed

4 files changed

+12
-23
lines changed

skeleton-common/usr/local/bin/scw-metadata

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ CACHE_FILE=/run/scw-metadata.cache
88
METADATA_IP=${METADATA_IP:-169.254.42.42}
99
METADATA_URL=${METADATA_URL:-"http://${METADATA_IP}/conf"}
1010

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+
1123
if [ "$1" = "--cached" -a -f $CACHE_FILE ]; then
1224
shift
1325
BODY=$(cat $CACHE_FILE)

skeleton-systemd/etc/systemd/system/scw-gen-machine-id.service

Lines changed: 0 additions & 10 deletions
This file was deleted.

skeleton-systemd/usr/local/sbin/oc-gen-machine-id

Lines changed: 0 additions & 1 deletion
This file was deleted.

skeleton-systemd/usr/local/sbin/scw-gen-machine-id

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)