test
sean 7 years ago
parent 8ca216cae2
commit 5e83fbf3d2

@ -2,4 +2,4 @@ Server Setup Script
===================== =====================
#Use# #Use#
wget -qO - https://code.totosearch.org/Sean/ServerSetup/setup.sh | sudo bash wget -qO - https://code.totosearch.org/Sean/ServerSetup/raw/branch/master/setup.sh | sudo bash

@ -24,16 +24,12 @@ fi
#calculate width and height of console #calculate width and height of console
width=`tput cols` width=`tput cols`
height=`tput lines` height=`tput lines`
window=$((height - 5))
# set line separator # set line separator
hold="$IFS"; IFS=$'\n'
devices=""; for device in $(ls /dev/disk/by-id | grep -v part); do devices="$devices $device off"; done devices=""; for device in $(ls /dev/disk/by-id | grep -v part); do devices="$devices $device off"; done
IFS="$hold"
disks=`dialog --separate-output --no-cancel --no-items --title "Root devices" --checklist "Select boot drives" $height $width ${window}$devices 2>&1 1>/dev/tty` 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 hostname=`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
IFS=$'\n'
nicdevices=""; for nic in $(ip -o link show | awk -F': ' '{print $2}' | grep -v '^lo'); do nicdevices="$nicdevices $nic off"; done nicdevices=""; for nic in $(ip -o link show | awk -F': ' '{print $2}' | grep -v '^lo'); do nicdevices="$nicdevices $nic off"; done
IFS="$hold"
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` 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`
for disk in "$disks"; do for disk in "$disks"; do

Loading…
Cancel
Save