diff --git a/README.md b/README.md index 9b4d03d..bd1b794 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,4 @@ Server Setup Script ===================== #Use# -curl -sSL https://code.totosearch.org/Sean/ServerSetup/setup.sh | sh +wget -qO - https://code.totosearch.org/Sean/ServerSetup/setup.sh | sudo bash diff --git a/setup.sh b/setup.sh index 8cf9628..9ac8316 100644 --- a/setup.sh +++ b/setup.sh @@ -4,18 +4,20 @@ echo "Updating and upgrading local packages..." apt-add-repository universe >/dev/null 2>/dev/null && apt update >/dev/null 2>/dev/null if [ "$?" = "0" ]; then - echo "Done.\n" + echo "Done." + echo "" else - echo "Failed to add universal repository, update apt repository - possibly bad network connection" + echo "Failed to add universal repository, update apt repository - possibly bad network connection." exit 1 fi echo "Installing required setup configuration utilities..." apt install -y dialog net-tools gdisk zfs-initramfs debootstrap >/dev/null 2>/dev/null if [ "$?" = "0" ]; then - echo "Done.\n" + echo "Done." + echo "" else - echo "Failed to install net-tools, gdisk, zfs-initramfs, or debootstrap" + echo "Failed to install net-tools, gdisk, zfs-initramfs, or debootstrap." exit 2 fi @@ -27,7 +29,7 @@ height=`tput lines` IFS=$'\n' devices=""; for device in $(ls /dev/disk/by-id | grep -v part); do devices="$devices $device off"; done disks=`dialog --separate-output --no-cancel --no-items --title "Root devices" --checklist "Select boot drives" $height $width ${window}$devices 2>&1 1>/dev/tty` -hostname=""; while [ -z "$hostname" ]; do result=`dialog --no-cancel --inputbox "Host name/Server name" 8 100 2>&1 >/dev/tty`; done +hostname=""; while [ -z "$hostname" ]; do hostname=`dialog --no-cancel --inputbox "Host name/Server name" 8 100 2>&1 >/dev/tty`; done nicdevices=""; for nic in $(ip -o link show | awk -F': ' '{print $2}' | grep -v '^lo'); do nicdevices="$nicdevices $nic off"; done nics=`dialog --separate-output --no-cancel --no-items --title "Network devices for bridge" --checklist "Select the network devices to be bridged" $height $width ${window}$nicdevices 2>&1 1>/dev/tty`