37 lines
1020 B
Bash
37 lines
1020 B
Bash
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
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
|
|
fi
|
|
|
|
echo -e "\n\nINSTALL LOG: $(date --rfc-3339=seconds)\n" >> /tmp/multiplane.log
|
|
|
|
info() {
|
|
echo -e "\e[34m[INFO]\e[39m $1"
|
|
echo "[INFO] $1" >> /tmp/multiplane.log
|
|
}
|
|
|
|
debug() {
|
|
if [[ ! -z "$DEBUG" ]]; then
|
|
echo -e "\e[96m[DEBUG]\e[39m $1"
|
|
fi
|
|
echo "[DEBUG] $1" >> /tmp/multiplane.log
|
|
}
|
|
|
|
warn() {
|
|
echo -e "\e[33m[WARNING]\e[39m $1"
|
|
echo "[WARNING] $1" >> /tmp/multiplane.log
|
|
}
|
|
|
|
fatal() {
|
|
echo -e "\e[31m[FATAL]\e[39m $1"
|
|
echo "[FATAL] $1" >> /tmp/multiplane.log
|
|
exit 1
|
|
}
|
|
|
|
|
|
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 |