mirror of
https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud.git
synced 2025-12-16 11:52:43 +03:00
30 lines
707 B
Bash
30 lines
707 B
Bash
# Tiny Cloud - Common Initialization
|
|
# vim:set ts=4 et ft=sh:
|
|
|
|
# set defaults
|
|
: "${LIBDIR:=$PREFIX/lib}"
|
|
. "$LIBDIR"/tiny-cloud/common
|
|
|
|
: "${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 ; }
|
|
|
|
# indicate bootstrap isn't done
|
|
bootstrap_incomplete() { rm -f "$TINY_CLOUD_VAR"/.bootstrap-complete ; }
|
|
|
|
# should we skip this action?
|
|
skip_action() {
|
|
local action="$1"
|
|
for i in $SKIP_INIT_ACTIONS; do
|
|
if [ "$i" = "$action" ]; then
|
|
printf " SKIPPING"
|
|
return 0
|
|
fi
|
|
done
|
|
return 1
|
|
}
|