Update mikrotik-routeros-v5.sh

code refactoring
pull/1220/head
tteckster 2 years ago committed by GitHub
parent 3fcf4af83d
commit a17e8372be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 23
      vm/mikrotik-routeros-v5.sh

@ -8,7 +8,7 @@
function header_info {
cat <<"EOF"
__ ____ __ __ _ __ ____ __ ____ _____
/ |/ (_) /___________ / /_(_) /__ / __ \____v5__ __/ /____ _____/ __ \/ ___/
/ |/ (_) /___________ / /_(_) /__ / __ \____ __ __/ /____ _____/ __ \/ ___/
/ /|_/ / / //_/ ___/ __ \/ __/ / //_/ / /_/ / __ \/ / / / __/ _ \/ ___/ / / /\__ \
/ / / / / < / / / /_/ / /_/ / < / _ _/ /_/ / /_/ / /_/ __/ / / /_/ /___/ /
/_/ /_/_/_/|_/_/ \____/\__/_/_/|_| /_/ |_|\____/\__,_/\__/\___/_/ \____//____/
@ -20,14 +20,14 @@ header_info
echo -e "Loading..."
GEN_MAC=$(echo '00 60 2f'$(od -An -N3 -t xC /dev/urandom) | sed -e 's/ /:/g' | tr '[:lower:]' '[:upper:]')
NEXTID=$(pvesh get /cluster/nextid)
YW=`echo "\033[33m"`
BL=`echo "\033[36m"`
HA=`echo "\033[1;34m"`
RD=`echo "\033[01;31m"`
BGN=`echo "\033[4;92m"`
GN=`echo "\033[1;92m"`
DGN=`echo "\033[32m"`
CL=`echo "\033[m"`
YW=$(echo "\033[33m")
BL=$(echo "\033[36m")
HA=$(echo "\033[1;34m")
RD=$(echo "\033[01;31m")
BGN=$(echo "\033[4;92m")
GN=$(echo "\033[1;92m")
DGN=$(echo "\033[32m")
CL=$(echo "\033[m")
BFR="\\r\\033[K"
HOLD="-"
CM="${GN}${CL}"
@ -62,7 +62,7 @@ function cleanup() {
}
TEMP_DIR=$(mktemp -d)
pushd $TEMP_DIR >/dev/null
if [ `pveversion | grep "pve-manager/7" | wc -l` -ne 1 ]; then
if [ $(pveversion | grep "pve-manager/7" | wc -l) -ne 1 ]; then
echo "⚠ This version of Proxmox Virtual Environment is not supported"
echo "Requires PVE Version: 7.XX"
echo "Exiting..."
@ -154,7 +154,8 @@ fi
VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
if [ -z $VLAN1 ]; then
VLAN1="Default" VLAN=""
echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
else
VLAN=",tag=$VLAN1"

Loading…
Cancel
Save