Downgrade/Upgrade Hetzner Machines
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
808 B

echo "$(green_bold "Downgrading the Hetzner VPS")"
echo "$(green_bold "===========================")"
echo "$(blue_bold "Loading VPS settings...")"
eval $(yaml_load "$filename")
echo "$(blue_bold "Executing the down commands on the VPS...")"
ssh $ssh_user@$ssh_host -p $ssh_port $commands_down
echo "$(blue_bold "Powering off the VPS...")"
hcloud server poweroff $vps_name
echo "$(blue_bold "Downgrading the VPS...")"
hcloud server change-type --keep-disk $vps_name $vps_type_downgrade
echo "$(blue_bold "Powering on the VPS...")"
hcloud server poweron $vps_name
echo "$(blue_bold "Waiting 15 seconds...")"
sleep 15
echo "$(blue_bold "Executing the up commands on the VPS...")"
ssh $ssh_user@$ssh_host -p $ssh_port $commands_up
echo "$(green_bold "Downgrade successful!")"