Merge pull request #84 from tteck/DHCP

DHCP configuration options
This commit is contained in:
tteckster 2022-03-20 13:13:59 -04:00 committed by GitHub
commit 9c9159fe7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 1383 additions and 44 deletions

View File

@ -82,9 +82,9 @@ show_menu2(){
}
option_picked(){
message=${@:-"${CL}Error: No message passed"}
message2=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message}${CL}\n"
printf " ${YW}${message2}${CL}\n"
}
show_menu2
while [ $opt != '' ]
@ -117,6 +117,52 @@ while [ $opt != '' ]
esac
fi
done
show_menu3(){
printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
read opt
}
option_picked(){
message3=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message2}${CL}\n"
printf " ${YW}${message3}${CL}\n"
}
show_menu3
while [ $opt != '' ]
do
if [ $opt = '' ]; then
exit;
else
case $opt in
1) clear;
header_info;
option_picked "Using Automatic DHCP";
DHCP=" "
break;
;;
2) clear;
header_info;
option_picked "Using Manual DHCP";
DHCP="1"
break;
;;
x)exit;
;;
\n)exit;
;;
*)clear;
option_picked "Please choose a DHCP Type from the menu";
show_menu3;
;;
esac
fi
done
set -o errexit
set -o errtrace
set -o nounset
@ -192,6 +238,19 @@ STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F "
if [ "$STORAGE_TYPE" == "zfspool" ]; then
warn "Some addons may not work due to ZFS not supporting 'fallocate'."
fi
if [ "$DHCP" == "1" ]; then
MAC=$(pct config $CTID \
| grep -i hwaddr \
| awk '{print substr($2, 31, length($3) 17 ) }') \
echo -e "MAC Address ${BL}$MAC${CL}"
dhcp_reservation(){
printf "Please set DHCP reservation and press Enter."
read
}
dhcp_reservation
fi
echo -en "${GN} Starting LXC Container... "
pct start $CTID

View File

@ -80,9 +80,9 @@ show_menu2(){
}
option_picked(){
message=${@:-"${CL}Error: No message passed"}
message2=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message}${CL}\n"
printf " ${YW}${message2}${CL}\n"
}
show_menu2
while [ $opt != '' ]
@ -115,6 +115,51 @@ while [ $opt != '' ]
esac
fi
done
show_menu3(){
printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
read opt
}
option_picked(){
message3=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message2}${CL}\n"
printf " ${YW}${message3}${CL}\n"
}
show_menu3
while [ $opt != '' ]
do
if [ $opt = '' ]; then
exit;
else
case $opt in
1) clear;
header_info;
option_picked "Using Automatic DHCP";
DHCP=" "
break;
;;
2) clear;
header_info;
option_picked "Using Manual DHCP";
DHCP="1"
break;
;;
x)exit;
;;
\n)exit;
;;
*)clear;
option_picked "Please choose a DHCP Type from the menu";
show_menu3;
;;
esac
fi
done
set -o errexit
set -o errtrace
@ -191,6 +236,19 @@ STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F "
if [ "$STORAGE_TYPE" == "zfspool" ]; then
warn "Some addons may not work due to ZFS not supporting 'fallocate'."
fi
if [ "$DHCP" == "1" ]; then
MAC=$(pct config $CTID \
| grep -i hwaddr \
| awk '{print substr($2, 31, length($3) 17 ) }') \
echo -e "MAC Address ${BL}$MAC${CL}"
dhcp_reservation(){
printf "Please set DHCP reservation and press Enter."
read
}
dhcp_reservation
fi
echo -en "${GN} Starting LXC Container... "
pct start $CTID

View File

@ -81,9 +81,9 @@ show_menu2(){
}
option_picked(){
message=${@:-"${CL}Error: No message passed"}
message2=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message}${CL}\n"
printf " ${YW}${message2}${CL}\n"
}
show_menu2
while [ $opt != '' ]
@ -116,6 +116,51 @@ while [ $opt != '' ]
esac
fi
done
show_menu3(){
printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
read opt
}
option_picked(){
message3=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message2}${CL}\n"
printf " ${YW}${message3}${CL}\n"
}
show_menu3
while [ $opt != '' ]
do
if [ $opt = '' ]; then
exit;
else
case $opt in
1) clear;
header_info;
option_picked "Using Automatic DHCP";
DHCP=" "
break;
;;
2) clear;
header_info;
option_picked "Using Manual DHCP";
DHCP="1"
break;
;;
x)exit;
;;
\n)exit;
;;
*)clear;
option_picked "Please choose a DHCP Type from the menu";
show_menu3;
;;
esac
fi
done
set -o errexit
set -o errtrace
@ -192,6 +237,19 @@ STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F "
if [ "$STORAGE_TYPE" == "zfspool" ]; then
warn "Some addons may not work due to ZFS not supporting 'fallocate'."
fi
if [ "$DHCP" == "1" ]; then
MAC=$(pct config $CTID \
| grep -i hwaddr \
| awk '{print substr($2, 31, length($3) 17 ) }') \
echo -e "MAC Address ${BL}$MAC${CL}"
dhcp_reservation(){
printf "Please set DHCP reservation and press Enter."
read
}
dhcp_reservation
fi
echo -en "${GN} Starting LXC Container... "
pct start $CTID

View File

@ -81,9 +81,9 @@ show_menu2(){
}
option_picked(){
message=${@:-"${CL}Error: No message passed"}
message2=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message}${CL}\n"
printf " ${YW}${message2}${CL}\n"
}
show_menu2
while [ $opt != '' ]
@ -116,6 +116,51 @@ while [ $opt != '' ]
esac
fi
done
show_menu3(){
printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
read opt
}
option_picked(){
message3=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message2}${CL}\n"
printf " ${YW}${message3}${CL}\n"
}
show_menu3
while [ $opt != '' ]
do
if [ $opt = '' ]; then
exit;
else
case $opt in
1) clear;
header_info;
option_picked "Using Automatic DHCP";
DHCP=" "
break;
;;
2) clear;
header_info;
option_picked "Using Manual DHCP";
DHCP="1"
break;
;;
x)exit;
;;
\n)exit;
;;
*)clear;
option_picked "Please choose a DHCP Type from the menu";
show_menu3;
;;
esac
fi
done
set -o errexit
set -o errtrace
@ -197,6 +242,19 @@ cat <<EOF >> $LXC_CONFIG
lxc.cgroup2.devices.allow: a
lxc.cap.drop:
EOF
if [ "$DHCP" == "1" ]; then
MAC=$(pct config $CTID \
| grep -i hwaddr \
| awk '{print substr($2, 31, length($3) 17 ) }') \
echo -e "MAC Address ${BL}$MAC${CL}"
dhcp_reservation(){
printf "Please set DHCP reservation and press Enter."
read
}
dhcp_reservation
fi
echo -en "${GN} Starting LXC Container... "
pct start $CTID

View File

@ -160,6 +160,52 @@ while [ $opt != '' ]
esac
fi
done
show_menu4(){
printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
read opt
}
option_picked(){
message4=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message2}${CL}\n"
printf " ${YW}${message3}${CL}\n"
printf " ${YW}${message4}${CL}\n"
}
show_menu4
while [ $opt != '' ]
do
if [ $opt = '' ]; then
exit;
else
case $opt in
1) clear;
header_info;
option_picked "Using Automatic DHCP";
DHCP=" "
break;
;;
2) clear;
header_info;
option_picked "Using Manual DHCP";
DHCP="1"
break;
;;
x)exit;
;;
\n)exit;
;;
*)clear;
option_picked "Please choose a DHCP Type from the menu";
show_menu4;
;;
esac
fi
done
set -o errexit
set -o errtrace
@ -248,6 +294,19 @@ cat <<EOF >> $LXC_CONFIG
lxc.cgroup2.devices.allow: a
lxc.cap.drop:
EOF
if [ "$DHCP" == "1" ]; then
MAC=$(pct config $CTID \
| grep -i hwaddr \
| awk '{print substr($2, 31, length($3) 17 ) }') \
echo -e "MAC Address ${BL}$MAC${CL}"
dhcp_reservation(){
printf "Please set DHCP reservation and press Enter."
read
}
dhcp_reservation
fi
echo -en "${GN} Starting LXC Container... "
pct start $CTID

View File

@ -81,9 +81,9 @@ show_menu2(){
}
option_picked(){
message=${@:-"${CL}Error: No message passed"}
message2=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message}${CL}\n"
printf " ${YW}${message2}${CL}\n"
}
show_menu2
while [ $opt != '' ]
@ -116,6 +116,51 @@ while [ $opt != '' ]
esac
fi
done
show_menu3(){
printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
read opt
}
option_picked(){
message3=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message2}${CL}\n"
printf " ${YW}${message3}${CL}\n"
}
show_menu3
while [ $opt != '' ]
do
if [ $opt = '' ]; then
exit;
else
case $opt in
1) clear;
header_info;
option_picked "Using Automatic DHCP";
DHCP=" "
break;
;;
2) clear;
header_info;
option_picked "Using Manual DHCP";
DHCP="1"
break;
;;
x)exit;
;;
\n)exit;
;;
*)clear;
option_picked "Please choose a DHCP Type from the menu";
show_menu3;
;;
esac
fi
done
set -o errexit
set -o errtrace
@ -197,6 +242,19 @@ cat <<EOF >> $LXC_CONFIG
lxc.cgroup2.devices.allow: a
lxc.cap.drop:
EOF
if [ "$DHCP" == "1" ]; then
MAC=$(pct config $CTID \
| grep -i hwaddr \
| awk '{print substr($2, 31, length($3) 17 ) }') \
echo -e "MAC Address ${BL}$MAC${CL}"
dhcp_reservation(){
printf "Please set DHCP reservation and press Enter."
read
}
dhcp_reservation
fi
echo -en "${GN} Starting LXC Container... "
pct start $CTID

View File

@ -79,9 +79,9 @@ show_menu2(){
}
option_picked(){
message=${@:-"${CL}Error: No message passed"}
message2=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message}${CL}\n"
printf " ${YW}${message2}${CL}\n"
}
show_menu2
while [ $opt != '' ]
@ -114,6 +114,51 @@ while [ $opt != '' ]
esac
fi
done
show_menu3(){
printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
read opt
}
option_picked(){
message3=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message2}${CL}\n"
printf " ${YW}${message3}${CL}\n"
}
show_menu3
while [ $opt != '' ]
do
if [ $opt = '' ]; then
exit;
else
case $opt in
1) clear;
header_info;
option_picked "Using Automatic DHCP";
DHCP=" "
break;
;;
2) clear;
header_info;
option_picked "Using Manual DHCP";
DHCP="1"
break;
;;
x)exit;
;;
\n)exit;
;;
*)clear;
option_picked "Please choose a DHCP Type from the menu";
show_menu3;
;;
esac
fi
done
set -o errexit
set -o errtrace
@ -190,6 +235,19 @@ STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F "
if [ "$STORAGE_TYPE" == "zfspool" ]; then
warn "Some addons may not work due to ZFS not supporting 'fallocate'."
fi
if [ "$DHCP" == "1" ]; then
MAC=$(pct config $CTID \
| grep -i hwaddr \
| awk '{print substr($2, 31, length($3) 17 ) }') \
echo -e "MAC Address ${BL}$MAC${CL}"
dhcp_reservation(){
printf "Please set DHCP reservation and press Enter."
read
}
dhcp_reservation
fi
echo -en "${GN} Starting LXC Container... "
pct start $CTID

View File

@ -79,9 +79,9 @@ show_menu2(){
}
option_picked(){
message=${@:-"${CL}Error: No message passed"}
message2=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message}${CL}\n"
printf " ${YW}${message2}${CL}\n"
}
show_menu2
while [ $opt != '' ]
@ -114,7 +114,100 @@ while [ $opt != '' ]
esac
fi
done
show_menu3(){
printf " ${RD} If Using ZFS, You Have Storage Driver Options${CL}\n"
printf " ${RD} Non ZFS, Select Standard overlay2 Storage Driver${CL}\n"
printf " ${YW} 1)${GN} Use fuse-overlayfs Storage Driver${CL}\n"
printf " ${YW} 2)${GN} Use Standard overlay2 Storage Driver${CL}\n"
printf "Please choose a Storage Driver and hit enter or ${RD}x${CL} to exit."
read opt
}
option_picked(){
message3=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message2}${CL}\n"
printf " ${YW}${message3}${CL}\n"
}
show_menu3
while [ $opt != '' ]
do
if [ $opt = '' ]; then
exit;
else
case $opt in
1) clear;
header_info;
option_picked "Using fuse-overlayfs Storage Driver";
STORAGE_DRIVER="fuse"
break;
;;
2) clear;
header_info;
option_picked "Using overlay2 Storage Driver";
STORAGE_DRIVER=" "
break;
;;
x)exit;
;;
\n)exit;
;;
*)clear;
option_picked "Please choose a Storage Driver from the menu";
show_menu3;
;;
esac
fi
done
show_menu4(){
printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
read opt
}
option_picked(){
message4=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message2}${CL}\n"
printf " ${YW}${message3}${CL}\n"
printf " ${YW}${message4}${CL}\n"
}
show_menu4
while [ $opt != '' ]
do
if [ $opt = '' ]; then
exit;
else
case $opt in
1) clear;
header_info;
option_picked "Using Automatic DHCP";
DHCP=" "
break;
;;
2) clear;
header_info;
option_picked "Using Manual DHCP";
DHCP="1"
break;
;;
x)exit;
;;
\n)exit;
;;
*)clear;
option_picked "Please choose a DHCP Type from the menu";
show_menu4;
;;
esac
fi
done
set -o errexit
set -o errtrace
set -o nounset
@ -161,8 +254,14 @@ function cleanup() {
popd >/dev/null
rm -rf $TEMP_DIR
}
if [ "$IM" == "1" ]; then
if [ "$IM" == "1" ] && [ "$STORAGE_DRIVER" == " " ]; then
FEATURES="nesting=1,keyctl=1"
elif
[ "$IM" == "1" ] && [ "$STORAGE_DRIVER" == "fuse" ]; then
FEATURES="nesting=1,keyctl=1,fuse=1"
elif
[ "$IM" == "0" ] && [ "$STORAGE_DRIVER" == "fuse" ]; then
FEATURES="nesting=1,fuse=1"
else
FEATURES="nesting=1"
fi
@ -195,11 +294,31 @@ cat <<EOF >> $LXC_CONFIG
lxc.cgroup2.devices.allow: a
lxc.cap.drop:
EOF
if [ "$DHCP" == "1" ]; then
MAC=$(pct config $CTID \
| grep -i hwaddr \
| awk '{print substr($2, 31, length($3) 17 ) }') \
echo -e "MAC Address ${BL}$MAC${CL}"
dhcp_reservation(){
printf "Please set DHCP reservation and press Enter."
read
}
dhcp_reservation
fi
echo -en "${GN} Starting LXC Container... "
pct start $CTID
echo -e "${CM}${CL} \r"
if [ "$STORAGE_TYPE" == "zfspool" ] && [ "$STORAGE_DRIVER" == "fuse" ]; then
pct push $CTID fuse-overlayfs /usr/local/bin/fuse-overlayfs -perms 755
info "Using ${BL}fuse-overlayfs${CL} Storage Driver."
else
info "Using ${BL}overlay2${CL} Storage Driver."
fi
alias lxc-cmd="lxc-attach -n $CTID --"
lxc-cmd bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/setup/homeassistant-install.sh)" || exit

View File

@ -78,9 +78,9 @@ show_menu2(){
}
option_picked(){
message=${@:-"${CL}Error: No message passed"}
message2=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message}${CL}\n"
printf " ${YW}${message2}${CL}\n"
}
show_menu2
while [ $opt != '' ]
@ -113,6 +113,51 @@ while [ $opt != '' ]
esac
fi
done
show_menu3(){
printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
read opt
}
option_picked(){
message3=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message2}${CL}\n"
printf " ${YW}${message3}${CL}\n"
}
show_menu3
while [ $opt != '' ]
do
if [ $opt = '' ]; then
exit;
else
case $opt in
1) clear;
header_info;
option_picked "Using Automatic DHCP";
DHCP=" "
break;
;;
2) clear;
header_info;
option_picked "Using Manual DHCP";
DHCP="1"
break;
;;
x)exit;
;;
\n)exit;
;;
*)clear;
option_picked "Please choose a DHCP Type from the menu";
show_menu3;
;;
esac
fi
done
set -o errexit
set -o errtrace
@ -189,6 +234,19 @@ STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F "
if [ "$STORAGE_TYPE" == "zfspool" ]; then
warn "Some addons may not work due to ZFS not supporting 'fallocate'."
fi
if [ "$DHCP" == "1" ]; then
MAC=$(pct config $CTID \
| grep -i hwaddr \
| awk '{print substr($2, 31, length($3) 17 ) }') \
echo -e "MAC Address ${BL}$MAC${CL}"
dhcp_reservation(){
printf "Please set DHCP reservation and press Enter."
read
}
dhcp_reservation
fi
echo -en "${GN} Starting LXC Container... "
pct start $CTID

View File

@ -79,9 +79,9 @@ show_menu2(){
}
option_picked(){
message=${@:-"${CL}Error: No message passed"}
message2=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message}${CL}\n"
printf " ${YW}${message2}${CL}\n"
}
show_menu2
while [ $opt != '' ]
@ -114,6 +114,51 @@ while [ $opt != '' ]
esac
fi
done
show_menu3(){
printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
read opt
}
option_picked(){
message3=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message2}${CL}\n"
printf " ${YW}${message3}${CL}\n"
}
show_menu3
while [ $opt != '' ]
do
if [ $opt = '' ]; then
exit;
else
case $opt in
1) clear;
header_info;
option_picked "Using Automatic DHCP";
DHCP=" "
break;
;;
2) clear;
header_info;
option_picked "Using Manual DHCP";
DHCP="1"
break;
;;
x)exit;
;;
\n)exit;
;;
*)clear;
option_picked "Please choose a DHCP Type from the menu";
show_menu3;
;;
esac
fi
done
set -o errexit
set -o errtrace
@ -190,6 +235,19 @@ STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F "
if [ "$STORAGE_TYPE" == "zfspool" ]; then
warn "Some addons may not work due to ZFS not supporting 'fallocate'."
fi
if [ "$DHCP" == "1" ]; then
MAC=$(pct config $CTID \
| grep -i hwaddr \
| awk '{print substr($2, 31, length($3) 17 ) }') \
echo -e "MAC Address ${BL}$MAC${CL}"
dhcp_reservation(){
printf "Please set DHCP reservation and press Enter."
read
}
dhcp_reservation
fi
echo -en "${GN} Starting LXC Container... "
pct start $CTID

View File

@ -79,9 +79,9 @@ show_menu2(){
}
option_picked(){
message=${@:-"${CL}Error: No message passed"}
message2=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message}${CL}\n"
printf " ${YW}${message2}${CL}\n"
}
show_menu2
while [ $opt != '' ]
@ -114,6 +114,51 @@ while [ $opt != '' ]
esac
fi
done
show_menu3(){
printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
read opt
}
option_picked(){
message3=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message2}${CL}\n"
printf " ${YW}${message3}${CL}\n"
}
show_menu3
while [ $opt != '' ]
do
if [ $opt = '' ]; then
exit;
else
case $opt in
1) clear;
header_info;
option_picked "Using Automatic DHCP";
DHCP=" "
break;
;;
2) clear;
header_info;
option_picked "Using Manual DHCP";
DHCP="1"
break;
;;
x)exit;
;;
\n)exit;
;;
*)clear;
option_picked "Please choose a DHCP Type from the menu";
show_menu3;
;;
esac
fi
done
set -o errexit
set -o errtrace
@ -190,6 +235,19 @@ STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F "
if [ "$STORAGE_TYPE" == "zfspool" ]; then
warn "Some addons may not work due to ZFS not supporting 'fallocate'."
fi
if [ "$DHCP" == "1" ]; then
MAC=$(pct config $CTID \
| grep -i hwaddr \
| awk '{print substr($2, 31, length($3) 17 ) }') \
echo -e "MAC Address ${BL}$MAC${CL}"
dhcp_reservation(){
printf "Please set DHCP reservation and press Enter."
read
}
dhcp_reservation
fi
echo -en "${GN} Starting LXC Container... "
pct start $CTID

View File

@ -80,9 +80,9 @@ show_menu2(){
}
option_picked(){
message=${@:-"${CL}Error: No message passed"}
message2=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message}${CL}\n"
printf " ${YW}${message2}${CL}\n"
}
show_menu2
while [ $opt != '' ]
@ -115,6 +115,51 @@ while [ $opt != '' ]
esac
fi
done
show_menu3(){
printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
read opt
}
option_picked(){
message3=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message2}${CL}\n"
printf " ${YW}${message3}${CL}\n"
}
show_menu3
while [ $opt != '' ]
do
if [ $opt = '' ]; then
exit;
else
case $opt in
1) clear;
header_info;
option_picked "Using Automatic DHCP";
DHCP=" "
break;
;;
2) clear;
header_info;
option_picked "Using Manual DHCP";
DHCP="1"
break;
;;
x)exit;
;;
\n)exit;
;;
*)clear;
option_picked "Please choose a DHCP Type from the menu";
show_menu3;
;;
esac
fi
done
set -o errexit
set -o errtrace
@ -196,6 +241,19 @@ cat <<EOF >> $LXC_CONFIG
lxc.cgroup2.devices.allow: a
lxc.cap.drop:
EOF
if [ "$DHCP" == "1" ]; then
MAC=$(pct config $CTID \
| grep -i hwaddr \
| awk '{print substr($2, 31, length($3) 17 ) }') \
echo -e "MAC Address ${BL}$MAC${CL}"
dhcp_reservation(){
printf "Please set DHCP reservation and press Enter."
read
}
dhcp_reservation
fi
echo -en "${GN} Starting LXC Container... "
pct start $CTID

View File

@ -79,9 +79,9 @@ show_menu2(){
}
option_picked(){
message=${@:-"${CL}Error: No message passed"}
message2=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message}${CL}\n"
printf " ${YW}${message2}${CL}\n"
}
show_menu2
while [ $opt != '' ]
@ -114,6 +114,51 @@ while [ $opt != '' ]
esac
fi
done
show_menu3(){
printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
read opt
}
option_picked(){
message3=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message2}${CL}\n"
printf " ${YW}${message3}${CL}\n"
}
show_menu3
while [ $opt != '' ]
do
if [ $opt = '' ]; then
exit;
else
case $opt in
1) clear;
header_info;
option_picked "Using Automatic DHCP";
DHCP=" "
break;
;;
2) clear;
header_info;
option_picked "Using Manual DHCP";
DHCP="1"
break;
;;
x)exit;
;;
\n)exit;
;;
*)clear;
option_picked "Please choose a DHCP Type from the menu";
show_menu3;
;;
esac
fi
done
set -o errexit
set -o errtrace
@ -190,6 +235,19 @@ STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F "
if [ "$STORAGE_TYPE" == "zfspool" ]; then
warn "Some addons may not work due to ZFS not supporting 'fallocate'."
fi
if [ "$DHCP" == "1" ]; then
MAC=$(pct config $CTID \
| grep -i hwaddr \
| awk '{print substr($2, 31, length($3) 17 ) }') \
echo -e "MAC Address ${BL}$MAC${CL}"
dhcp_reservation(){
printf "Please set DHCP reservation and press Enter."
read
}
dhcp_reservation
fi
echo -en "${GN} Starting LXC Container... "
pct start $CTID

View File

@ -78,9 +78,9 @@ show_menu2(){
}
option_picked(){
message=${@:-"${CL}Error: No message passed"}
message2=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message}${CL}\n"
printf " ${YW}${message2}${CL}\n"
}
show_menu2
while [ $opt != '' ]
@ -113,6 +113,51 @@ while [ $opt != '' ]
esac
fi
done
show_menu3(){
printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
read opt
}
option_picked(){
message3=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message2}${CL}\n"
printf " ${YW}${message3}${CL}\n"
}
show_menu3
while [ $opt != '' ]
do
if [ $opt = '' ]; then
exit;
else
case $opt in
1) clear;
header_info;
option_picked "Using Automatic DHCP";
DHCP=" "
break;
;;
2) clear;
header_info;
option_picked "Using Manual DHCP";
DHCP="1"
break;
;;
x)exit;
;;
\n)exit;
;;
*)clear;
option_picked "Please choose a DHCP Type from the menu";
show_menu3;
;;
esac
fi
done
set -o errexit
set -o errtrace
@ -189,6 +234,19 @@ STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F "
if [ "$STORAGE_TYPE" == "zfspool" ]; then
warn "Some addons may not work due to ZFS not supporting 'fallocate'."
fi
if [ "$DHCP" == "1" ]; then
MAC=$(pct config $CTID \
| grep -i hwaddr \
| awk '{print substr($2, 31, length($3) 17 ) }') \
echo -e "MAC Address ${BL}$MAC${CL}"
dhcp_reservation(){
printf "Please set DHCP reservation and press Enter."
read
}
dhcp_reservation
fi
echo -en "${GN} Starting LXC Container... "
pct start $CTID

View File

@ -79,9 +79,9 @@ show_menu2(){
}
option_picked(){
message=${@:-"${CL}Error: No message passed"}
message2=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message}${CL}\n"
printf " ${YW}${message2}${CL}\n"
}
show_menu2
while [ $opt != '' ]
@ -114,6 +114,51 @@ while [ $opt != '' ]
esac
fi
done
show_menu3(){
printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
read opt
}
option_picked(){
message3=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message2}${CL}\n"
printf " ${YW}${message3}${CL}\n"
}
show_menu3
while [ $opt != '' ]
do
if [ $opt = '' ]; then
exit;
else
case $opt in
1) clear;
header_info;
option_picked "Using Automatic DHCP";
DHCP=" "
break;
;;
2) clear;
header_info;
option_picked "Using Manual DHCP";
DHCP="1"
break;
;;
x)exit;
;;
\n)exit;
;;
*)clear;
option_picked "Please choose a DHCP Type from the menu";
show_menu3;
;;
esac
fi
done
set -o errexit
set -o errtrace
@ -190,6 +235,19 @@ STORAGE_TYPE=$(pvesm status -storage $(pct config $CTID | grep rootfs | awk -F "
if [ "$STORAGE_TYPE" == "zfspool" ]; then
warn "Some addons may not work due to ZFS not supporting 'fallocate'."
fi
if [ "$DHCP" == "1" ]; then
MAC=$(pct config $CTID \
| grep -i hwaddr \
| awk '{print substr($2, 31, length($3) 17 ) }') \
echo -e "MAC Address ${BL}$MAC${CL}"
dhcp_reservation(){
printf "Please set DHCP reservation and press Enter."
read
}
dhcp_reservation
fi
echo -en "${GN} Starting LXC Container... "
pct start $CTID

View File

@ -81,9 +81,9 @@ show_menu2(){
}
option_picked(){
message=${@:-"${CL}Error: No message passed"}
message2=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message}${CL}\n"
printf " ${YW}${message2}${CL}\n"
}
show_menu2
while [ $opt != '' ]
@ -116,6 +116,51 @@ while [ $opt != '' ]
esac
fi
done
show_menu3(){
printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
read opt
}
option_picked(){
message3=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message2}${CL}\n"
printf " ${YW}${message3}${CL}\n"
}
show_menu3
while [ $opt != '' ]
do
if [ $opt = '' ]; then
exit;
else
case $opt in
1) clear;
header_info;
option_picked "Using Automatic DHCP";
DHCP=" "
break;
;;
2) clear;
header_info;
option_picked "Using Manual DHCP";
DHCP="1"
break;
;;
x)exit;
;;
\n)exit;
;;
*)clear;
option_picked "Please choose a DHCP Type from the menu";
show_menu3;
;;
esac
fi
done
set -o errexit
set -o errtrace
@ -197,6 +242,19 @@ cat <<EOF >> $LXC_CONFIG
lxc.cgroup2.devices.allow: a
lxc.cap.drop:
EOF
if [ "$DHCP" == "1" ]; then
MAC=$(pct config $CTID \
| grep -i hwaddr \
| awk '{print substr($2, 31, length($3) 17 ) }') \
echo -e "MAC Address ${BL}$MAC${CL}"
dhcp_reservation(){
printf "Please set DHCP reservation and press Enter."
read
}
dhcp_reservation
fi
echo -en "${GN} Starting LXC Container... "
pct start $CTID

View File

@ -80,9 +80,9 @@ show_menu2(){
}
option_picked(){
message=${@:-"${CL}Error: No message passed"}
message2=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message}${CL}\n"
printf " ${YW}${message2}${CL}\n"
}
show_menu2
while [ $opt != '' ]
@ -115,6 +115,51 @@ while [ $opt != '' ]
esac
fi
done
show_menu3(){
printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
read opt
}
option_picked(){
message3=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message2}${CL}\n"
printf " ${YW}${message3}${CL}\n"
}
show_menu3
while [ $opt != '' ]
do
if [ $opt = '' ]; then
exit;
else
case $opt in
1) clear;
header_info;
option_picked "Using Automatic DHCP";
DHCP=" "
break;
;;
2) clear;
header_info;
option_picked "Using Manual DHCP";
DHCP="1"
break;
;;
x)exit;
;;
\n)exit;
;;
*)clear;
option_picked "Please choose a DHCP Type from the menu";
show_menu3;
;;
esac
fi
done
set -o errexit
set -o errtrace
@ -196,6 +241,19 @@ cat <<EOF >> $LXC_CONFIG
lxc.cgroup2.devices.allow: a
lxc.cap.drop:
EOF
if [ "$DHCP" == "1" ]; then
MAC=$(pct config $CTID \
| grep -i hwaddr \
| awk '{print substr($2, 31, length($3) 17 ) }') \
echo -e "MAC Address ${BL}$MAC${CL}"
dhcp_reservation(){
printf "Please set DHCP reservation and press Enter."
read
}
dhcp_reservation
fi
echo -en "${GN} Starting LXC Container... "
pct start $CTID

View File

@ -81,9 +81,9 @@ show_menu2(){
}
option_picked(){
message=${@:-"${CL}Error: No message passed"}
message2=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message}${CL}\n"
printf " ${YW}${message2}${CL}\n"
}
show_menu2
while [ $opt != '' ]
@ -116,6 +116,51 @@ while [ $opt != '' ]
esac
fi
done
show_menu3(){
printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
read opt
}
option_picked(){
message3=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message2}${CL}\n"
printf " ${YW}${message3}${CL}\n"
}
show_menu3
while [ $opt != '' ]
do
if [ $opt = '' ]; then
exit;
else
case $opt in
1) clear;
header_info;
option_picked "Using Automatic DHCP";
DHCP=" "
break;
;;
2) clear;
header_info;
option_picked "Using Manual DHCP";
DHCP="1"
break;
;;
x)exit;
;;
\n)exit;
;;
*)clear;
option_picked "Please choose a DHCP Type from the menu";
show_menu3;
;;
esac
fi
done
set -o errexit
set -o errtrace
@ -197,6 +242,19 @@ cat <<EOF >> $LXC_CONFIG
lxc.cgroup2.devices.allow: a
lxc.cap.drop:
EOF
if [ "$DHCP" == "1" ]; then
MAC=$(pct config $CTID \
| grep -i hwaddr \
| awk '{print substr($2, 31, length($3) 17 ) }') \
echo -e "MAC Address ${BL}$MAC${CL}"
dhcp_reservation(){
printf "Please set DHCP reservation and press Enter."
read
}
dhcp_reservation
fi
echo -en "${GN} Starting LXC Container... "
pct start $CTID

View File

@ -79,9 +79,9 @@ show_menu2(){
}
option_picked(){
message=${@:-"${CL}Error: No message passed"}
message2=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message}${CL}\n"
printf " ${YW}${message2}${CL}\n"
}
show_menu2
while [ $opt != '' ]
@ -114,6 +114,51 @@ while [ $opt != '' ]
esac
fi
done
show_menu3(){
printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
read opt
}
option_picked(){
message3=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message2}${CL}\n"
printf " ${YW}${message3}${CL}\n"
}
show_menu3
while [ $opt != '' ]
do
if [ $opt = '' ]; then
exit;
else
case $opt in
1) clear;
header_info;
option_picked "Using Automatic DHCP";
DHCP=" "
break;
;;
2) clear;
header_info;
option_picked "Using Manual DHCP";
DHCP="1"
break;
;;
x)exit;
;;
\n)exit;
;;
*)clear;
option_picked "Please choose a DHCP Type from the menu";
show_menu3;
;;
esac
fi
done
set -o errexit
set -o errtrace
@ -195,6 +240,19 @@ cat <<EOF >> $LXC_CONFIG
lxc.cgroup2.devices.allow: a
lxc.cap.drop:
EOF
if [ "$DHCP" == "1" ]; then
MAC=$(pct config $CTID \
| grep -i hwaddr \
| awk '{print substr($2, 31, length($3) 17 ) }') \
echo -e "MAC Address ${BL}$MAC${CL}"
dhcp_reservation(){
printf "Please set DHCP reservation and press Enter."
read
}
dhcp_reservation
fi
echo -en "${GN} Starting LXC Container... "
pct start $CTID

View File

@ -81,9 +81,9 @@ show_menu2(){
}
option_picked(){
message=${@:-"${CL}Error: No message passed"}
message2=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message}${CL}\n"
printf " ${YW}${message2}${CL}\n"
}
show_menu2
while [ $opt != '' ]
@ -116,6 +116,51 @@ while [ $opt != '' ]
esac
fi
done
show_menu3(){
printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
read opt
}
option_picked(){
message3=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message2}${CL}\n"
printf " ${YW}${message3}${CL}\n"
}
show_menu3
while [ $opt != '' ]
do
if [ $opt = '' ]; then
exit;
else
case $opt in
1) clear;
header_info;
option_picked "Using Automatic DHCP";
DHCP=" "
break;
;;
2) clear;
header_info;
option_picked "Using Manual DHCP";
DHCP="1"
break;
;;
x)exit;
;;
\n)exit;
;;
*)clear;
option_picked "Please choose a DHCP Type from the menu";
show_menu3;
;;
esac
fi
done
set -o errexit
set -o errtrace
@ -197,6 +242,19 @@ cat <<EOF >> $LXC_CONFIG
lxc.cgroup2.devices.allow: a
lxc.cap.drop:
EOF
if [ "$DHCP" == "1" ]; then
MAC=$(pct config $CTID \
| grep -i hwaddr \
| awk '{print substr($2, 31, length($3) 17 ) }') \
echo -e "MAC Address ${BL}$MAC${CL}"
dhcp_reservation(){
printf "Please set DHCP reservation and press Enter."
read
}
dhcp_reservation
fi
echo -en "${GN} Starting LXC Container... "
pct start $CTID

View File

@ -81,9 +81,9 @@ show_menu2(){
}
option_picked(){
message=${@:-"${CL}Error: No message passed"}
message2=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message}${CL}\n"
printf " ${YW}${message2}${CL}\n"
}
show_menu2
while [ $opt != '' ]
@ -116,6 +116,51 @@ while [ $opt != '' ]
esac
fi
done
show_menu3(){
printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
read opt
}
option_picked(){
message3=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message2}${CL}\n"
printf " ${YW}${message3}${CL}\n"
}
show_menu3
while [ $opt != '' ]
do
if [ $opt = '' ]; then
exit;
else
case $opt in
1) clear;
header_info;
option_picked "Using Automatic DHCP";
DHCP=" "
break;
;;
2) clear;
header_info;
option_picked "Using Manual DHCP";
DHCP="1"
break;
;;
x)exit;
;;
\n)exit;
;;
*)clear;
option_picked "Please choose a DHCP Type from the menu";
show_menu3;
;;
esac
fi
done
set -o errexit
set -o errtrace
@ -203,6 +248,19 @@ lxc.mount.entry: /dev/serial/by-id dev/serial/by-id none bind,optional,create=
lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
lxc.mount.entry: /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file
EOF
if [ "$DHCP" == "1" ]; then
MAC=$(pct config $CTID \
| grep -i hwaddr \
| awk '{print substr($2, 31, length($3) 17 ) }') \
echo -e "MAC Address ${BL}$MAC${CL}"
dhcp_reservation(){
printf "Please set DHCP reservation and press Enter."
read
}
dhcp_reservation
fi
echo -en "${GN} Starting LXC Container... "
pct start $CTID

View File

@ -82,9 +82,9 @@ show_menu2(){
}
option_picked(){
message=${@:-"${CL}Error: No message passed"}
message2=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message}${CL}\n"
printf " ${YW}${message2}${CL}\n"
}
show_menu2
while [ $opt != '' ]
@ -117,6 +117,51 @@ while [ $opt != '' ]
esac
fi
done
show_menu3(){
printf " ${YW} 1)${GN} Automatic DHCP ${CL}\n"
printf " ${YW} 2)${GN} Manual DHCP ${CL}\n"
printf "Please choose a DHCP Type and hit enter or ${RD}x${CL} to exit."
read opt
}
option_picked(){
message3=${@:-"${CL}Error: No message passed"}
printf " ${YW}${message1}${CL}\n"
printf " ${YW}${message2}${CL}\n"
printf " ${YW}${message3}${CL}\n"
}
show_menu3
while [ $opt != '' ]
do
if [ $opt = '' ]; then
exit;
else
case $opt in
1) clear;
header_info;
option_picked "Using Automatic DHCP";
DHCP=" "
break;
;;
2) clear;
header_info;
option_picked "Using Manual DHCP";
DHCP="1"
break;
;;
x)exit;
;;
\n)exit;
;;
*)clear;
option_picked "Please choose a DHCP Type from the menu";
show_menu3;
;;
esac
fi
done
set -o errexit
set -o errtrace
@ -204,6 +249,19 @@ lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=
lxc.mount.entry: /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file
lxc.mount.entry: /dev/ttyACM1 dev/ttyACM1 none bind,optional,create=file
EOF
if [ "$DHCP" == "1" ]; then
MAC=$(pct config $CTID \
| grep -i hwaddr \
| awk '{print substr($2, 31, length($3) 17 ) }') \
echo -e "MAC Address ${BL}$MAC${CL}"
dhcp_reservation(){
printf "Please set DHCP reservation and press Enter."
read
}
dhcp_reservation
fi
echo -en "${GN} Starting LXC Container... "
pct start $CTID