1
0
mirror of https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud.git synced 2025-12-16 03:42:44 +03:00
tiny-cloud/lib/tiny-cloud/init-common
Jake Buchholz Göktürk 64a6c4ea4f * initial round of nocloud should be just about complete, pending tests
* update README, example config
* nocloud and aws share IMDS layout, move vars and funcs from aws imds lib to main imds script
* IMDS_USERDATA value is no longer configurable
* note that azure and oci are missing some network bits yet
2022-07-10 20:22:59 -07:00

28 lines
779 B
Bash

# Tiny Cloud - Common Initialization
# vim:set ts=4 et ft=sh:
[ -f /etc/conf.d/tiny-cloud ] && source /etc/conf.d/tiny-cloud
# set defaults
CLOUD_USER=${CLOUD_USER:-alpine}
TINY_CLOUD_LOGS=${TINY_CLOUD_LOGS:-/var/log}
TINY_CLOUD_VAR=${TINY_CLOUD_VAR:-/var/lib/cloud}
SKIP_INIT_ACTIONS=${SKIP_INIT_ACTIONS:-}
# is initial bootstrap already done?
is_bootstrapped() { [ -f "$TINY_CLOUD_VAR"/.bootstrap-complete ]; }
# indicate bootstrap is done
bootstrap_complete() { touch "$TINY_CLOUD_VAR"/.bootstrap-complete ]; }
# should we skip this action?
skip_action() {
local action="$1"
# no action? don't skip.
[ -z "$action" ] && return 1
# action not in the skip list?
echo "$SKIP_INIT_ACTIONS" | grep -Eq "\b$action\b" || return 1
echo -n " SKIPPING"
}