diff --git a/multiplane.sh b/multiplane.sh index 7099bf3..c0a4f1c 100644 --- a/multiplane.sh +++ b/multiplane.sh @@ -2,6 +2,8 @@ set -e +$CONFIG_FILE="${$1:-config.toml}" + if [[ "$EUID" -ne 0 ]]; then echo -e "\e[31m[FATAL]\e[39m Currently this script requires being ran as root user - please try again as root." exit 1 @@ -33,5 +35,5 @@ fatal() { } -yq -i ".k0s.hostname = \"$(gum input --placeholder "Cluster Domain:" --prompt "* " --width 80 --value "$(yq '.k0s.hostname' config.yaml)")\"" config.yaml -yq -i ".k0s.private_ip_range = \"$(gum input --placeholder "Node IP Range::" --prompt "* " --width 80 --value "$(yq '.k0s.private_ip_range' config.yaml)")\"" config.yaml \ No newline at end of file +yq -i ".k0s.hostname = \"$(gum input --placeholder "Cluster Domain:" --prompt "* " --width 80 --value "$(yq '.k0s.hostname' $CONFIG_FILE)")\"" $CONFIG_FILE +yq -i ".k0s.private_ip_range = \"$(gum input --placeholder "Node IP Range::" --prompt "* " --width 80 --value "$(yq '.k0s.private_ip_range' $CONFIG_FILE)")\"" $CONFIG_FILE \ No newline at end of file