mirror of https://github.com/tteck/Proxmox.git
Update openwrt.sh
Compactify script and fix text (WAN Vlan).
This commit is contained in:
parent
89e933e85e
commit
29faf8d718
|
@ -243,11 +243,10 @@ function advanced_settings() {
|
|||
if VM_NAME=$(whiptail --inputbox "Set Hostname" 8 58 openwrt --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
|
||||
if [ -z $VM_NAME ]; then
|
||||
HN="openwrt"
|
||||
echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
|
||||
else
|
||||
HN=$(echo ${VM_NAME,,} | tr -d ' ')
|
||||
echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
|
||||
fi
|
||||
echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
|
||||
else
|
||||
exit-script
|
||||
fi
|
||||
|
@ -255,10 +254,8 @@ function advanced_settings() {
|
|||
if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 1 --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
|
||||
if [ -z $CORE_COUNT ]; then
|
||||
CORE_COUNT="1"
|
||||
echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
|
||||
else
|
||||
echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
|
||||
fi
|
||||
echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
|
||||
else
|
||||
exit-script
|
||||
fi
|
||||
|
@ -266,10 +263,8 @@ function advanced_settings() {
|
|||
if RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 256 --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
|
||||
if [ -z $RAM_SIZE ]; then
|
||||
RAM_SIZE="256"
|
||||
echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
|
||||
else
|
||||
echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
|
||||
fi
|
||||
echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
|
||||
else
|
||||
exit-script
|
||||
fi
|
||||
|
@ -277,10 +272,8 @@ function advanced_settings() {
|
|||
if BRG=$(whiptail --inputbox "Set a WAN Bridge" 8 58 vmbr0 --title "WAN BRIDGE" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
|
||||
if [ -z $BRG ]; then
|
||||
BRG="vmbr0"
|
||||
echo -e "${DGN}Using WAN Bridge: ${BGN}$BRG${CL}"
|
||||
else
|
||||
echo -e "${DGN}Using WAN Bridge: ${BGN}$BRG${CL}"
|
||||
fi
|
||||
echo -e "${DGN}Using WAN Bridge: ${BGN}$BRG${CL}"
|
||||
else
|
||||
exit-script
|
||||
fi
|
||||
|
@ -288,10 +281,8 @@ function advanced_settings() {
|
|||
if LAN_BRG=$(whiptail --inputbox "Set a LAN Bridge" 8 58 vmbr0 --title "LAN BRIDGE" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
|
||||
if [ -z $LAN_BRG ]; then
|
||||
LAN_BRG="vmbr0"
|
||||
echo -e "${DGN}Using LAN Bridge: ${BGN}$LAN_BRG${CL}"
|
||||
else
|
||||
echo -e "${DGN}Using LAN Bridge: ${BGN}$LAN_BRG${CL}"
|
||||
fi
|
||||
echo -e "${DGN}Using LAN Bridge: ${BGN}$LAN_BRG${CL}"
|
||||
else
|
||||
exit-script
|
||||
fi
|
||||
|
@ -299,11 +290,10 @@ function advanced_settings() {
|
|||
if MAC1=$(whiptail --inputbox "Set a WAN MAC Address" 8 58 $GEN_MAC --title "WAN MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
|
||||
if [ -z $MAC1 ]; then
|
||||
MAC="$GEN_MAC"
|
||||
echo -e "${DGN}Using WAN MAC Address: ${BGN}$MAC${CL}"
|
||||
else
|
||||
MAC="$MAC1"
|
||||
echo -e "${DGN}Using WAN MAC Address: ${BGN}$MAC1${CL}"
|
||||
fi
|
||||
echo -e "${DGN}Using WAN MAC Address: ${BGN}$MAC${CL}"
|
||||
else
|
||||
exit-script
|
||||
fi
|
||||
|
@ -311,24 +301,22 @@ function advanced_settings() {
|
|||
if MAC2=$(whiptail --inputbox "Set a LAN MAC Address" 8 58 $GEN_MAC_LAN --title "LAN MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
|
||||
if [ -z $MAC2 ]; then
|
||||
LAN_MAC="$GEN_MAC_LAN"
|
||||
echo -e "${DGN}Using LAN MAC Address: ${BGN}$LAN_MAC${CL}"
|
||||
else
|
||||
LAN_MAC="$MAC2"
|
||||
echo -e "${DGN}Using LAN MAC Address: ${BGN}$MAC2${CL}"
|
||||
fi
|
||||
echo -e "${DGN}Using LAN MAC Address: ${BGN}$LAN_MAC${CL}"
|
||||
else
|
||||
exit-script
|
||||
fi
|
||||
|
||||
if VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "WAN VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
|
||||
if VLAN1=$(whiptail --inputbox "Set a WAN Vlan (leave blank for default)" 8 58 --title "WAN VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
|
||||
if [ -z $VLAN1 ]; then
|
||||
VLAN1="Default"
|
||||
VLAN=""
|
||||
echo -e "${DGN}Using WAN Vlan: ${BGN}$VLAN1${CL}"
|
||||
else
|
||||
VLAN=",tag=$VLAN1"
|
||||
echo -e "${DGN}Using WAN Vlan: ${BGN}$VLAN1${CL}"
|
||||
fi
|
||||
echo -e "${DGN}Using WAN Vlan: ${BGN}$VLAN1${CL}"
|
||||
else
|
||||
exit-script
|
||||
fi
|
||||
|
@ -337,11 +325,10 @@ function advanced_settings() {
|
|||
if [ -z $VLAN2 ]; then
|
||||
VLAN2="999"
|
||||
LAN_VLAN=",tag=$VLAN2"
|
||||
echo -e "${DGN}Using LAN Vlan: ${BGN}$VLAN2${CL}"
|
||||
else
|
||||
LAN_VLAN=",tag=$VLAN2"
|
||||
echo -e "${DGN}Using LAN Vlan: ${BGN}$VLAN2${CL}"
|
||||
fi
|
||||
echo -e "${DGN}Using LAN Vlan: ${BGN}$VLAN2${CL}"
|
||||
else
|
||||
exit-script
|
||||
fi
|
||||
|
@ -350,22 +337,20 @@ function advanced_settings() {
|
|||
if [ -z $MTU1 ]; then
|
||||
MTU1="Default"
|
||||
MTU=""
|
||||
echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
|
||||
else
|
||||
MTU=",mtu=$MTU1"
|
||||
echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
|
||||
fi
|
||||
echo -e "${DGN}Using Interface MTU Size: ${BGN}$MTU1${CL}"
|
||||
else
|
||||
exit-script
|
||||
fi
|
||||
|
||||
if (whiptail --title "START VIRTUAL MACHINE" --yesno "Start VM when completed?" 10 58); then
|
||||
echo -e "${DGN}Start VM when completed: ${BGN}yes${CL}"
|
||||
START_VM="yes"
|
||||
else
|
||||
echo -e "${DGN}Start VM when completed: ${BGN}no${CL}"
|
||||
START_VM="no"
|
||||
fi
|
||||
echo -e "${DGN}Start VM when completed: ${BGN}$START_VM${CL}"
|
||||
|
||||
if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create OpenWrt VM?" --no-button Do-Over 10 58); then
|
||||
echo -e "${RD}Creating a OpenWrt VM using the above advanced settings${CL}"
|
||||
|
|
Loading…
Reference in New Issue