#!/bin/sh connection_test() { key_file="$1" tilde_username="$2" tilde_name="$3" ssh_command="ssh -i $key_file $tilde_username@$tilde_name" echo "Running \`$ssh_command\`..." while ! $ssh_command 'exit' do echo "There seems to be a problem connecting to the tilde" echo "Use this shell to try and fix any problems, then try connecting again by exiting the shell" echo "Use \`exit 1\` to abort the install" bash || fail done echo "Connection success!" } configure_network() { if [ "$(nmcli networking connectivity)" != "full" ] then echo "Press ENTER to configure network" read dummy_var nmtui clear else echo "Network already configured, skipping..." fi }