diff --git a/README.md b/README.md index 1b3d9de..5cb25a9 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,8 @@ On a fresh Armbian device: apt install git git clone https://gut.oily.dad/justin/tinyboard cd tinyboard -./spoke/setup-network.sh # configure static IP — SSH session will drop, reconnect -./setup.sh # choose option 1 +./setup.sh # choose option 0 to configure static IP — SSH session will drop, reconnect +./setup.sh # choose option 1 ``` ### Onboarding a Spoke from the Hub @@ -94,6 +94,7 @@ tinyboard/ ### `setup.sh` Entry point. Presents a menu: +0. Reconfigure network (static IP via netplan — SSH session will drop, reconnect) 1. Set up this device as a new spoke 2. Onboard a new spoke from the hub 3. Offboard a spoke from the hub diff --git a/setup.sh b/setup.sh index 2faa661..d040323 100755 --- a/setup.sh +++ b/setup.sh @@ -15,14 +15,20 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" header "TinyBoard Setup" echo "" +echo " 0) Reconfigure network" echo " 1) Set up this device as a new spoke" echo " 2) Onboard a new spoke from the hub" echo " 3) Offboard a spoke from the hub" echo " 4) Set up this device as a new hub" echo "" -read -rp "Choose [1/2/3/4]: " CHOICE +read -rp "Choose [0/1/2/3/4]: " CHOICE case "$CHOICE" in +0) + [ "$(id -u)" -eq 0 ] || die "Network reconfiguration must be run as root" + info "Starting network reconfiguration..." + exec "$SCRIPT_DIR/spoke/setup-network.sh" + ;; 1) [ "$(id -u)" -eq 0 ] || die "Spoke setup must be run as root" info "Starting spoke setup..."