1
0
mirror of https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud.git synced 2025-12-16 20:02:43 +03:00
tiny-cloud/etc/init.d/tiny-cloud
2023-03-08 03:39:39 +00:00

35 lines
606 B
Bash
Executable File

#!/sbin/openrc-run
# vim:set ts=8 noet ft=sh:
description="Tiny Cloud Bootstrap - main phase"
extra_commands="complete incomplete"
: "${LIBDIR:=$PREFIX/lib}"
. "$LIBDIR"/tiny-cloud/init-main
depend() {
need net
before sshd
}
start() {
is_bootstrapped && return 0
ebegin "Saving Instance UserData"
save_userdata
eend $?
ebegin "Setting Instance Hostname"
set_hostname
eend $?
ebegin "Installing SSH Keys for $CLOUD_USER User"
set_ssh_keys "$CLOUD_USER"
eend $?
}
# allow setting / unsetting of bootstrap state
complete() { bootstrap_complete ; }
incomplete() { bootstrap_incomplete ; }