Fix error formatting, module activation

This commit is contained in:
fnux 2020-01-23 15:38:09 +01:00
parent b2f473c9f5
commit 8cc118e1f8
1 changed files with 5 additions and 7 deletions

View File

@ -77,16 +77,14 @@ deploy_ssh_authorized_keys () {
curl_output=$(mktemp) curl_output=$(mktemp)
if ! curl "$UNCLOUD_METADATA_SERVER/fnux" --output "$curl_output"; then if ! curl "$UNCLOUD_METADATA_SERVER/fnux" --output "$curl_output"; then
echo "Something went wrong fetching the authorized_keys file from the \ echo "Something went wrong fetching the authorized_keys file from the metedata server." >&2
metedata server." >&2
echo "CURL Output: $(cat "$curl_output")" echo "CURL Output: $(cat "$curl_output")"
rm "$curl_output" rm "$curl_output"
exit 1 exit 1
fi fi
mv "$curl_output" "$authorized_keys_file" mv "$curl_output" "$authorized_keys_file"
echo "Deployed $(wc -l < "$authorized_keys_file") entries in \ echo "Deployed $(wc -l < "$authorized_keys_file") entries in $authorized_keys_file."
$authorized_keys_file."
} }
grow_root_partition () { grow_root_partition () {
@ -112,21 +110,21 @@ up_network_interfaces () {
### ###
# Entrypoint. # Entrypoint.
if [ $ENABLE_NETWORKING ]; then if [ "$ENABLE_NETWORKING" = '1' ]; then
routine='up main network interface' routine='up main network interface'
echo "--- RUNNING $routine..." echo "--- RUNNING $routine..."
up_network_interfaces up_network_interfaces
echo "--- DONE with $routine." echo "--- DONE with $routine."
fi fi
if [ $DEPLOY_SSH_AUTHORIZED_KEYS ]; then if [ "$DEPLOY_SSH_AUTHORIZED_KEYS" = '1' ]; then
routine='SSH authorized_keys deployment routine' routine='SSH authorized_keys deployment routine'
echo "--- RUNNING $routine..." echo "--- RUNNING $routine..."
deploy_ssh_authorized_keys deploy_ssh_authorized_keys
echo "--- DONE with $routine." echo "--- DONE with $routine."
fi fi
if [ $GROW_ROOT_PARTITION ]; then if [ "$GROW_ROOT_PARTITION" = '1' ]; then
routine='growing root partition and filesystem' routine='growing root partition and filesystem'
echo "--- RUNNING $routine..." echo "--- RUNNING $routine..."
grow_root_partition grow_root_partition