diff --git a/ct/adguard.sh b/ct/adguard.sh index 69e27ea8..ac8278f8 100644 --- a/ct/adguard.sh +++ b/ct/adguard.sh @@ -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 diff --git a/ct/daemonsync.sh b/ct/daemonsync.sh index 0a12272b..c6403ba5 100644 --- a/ct/daemonsync.sh +++ b/ct/daemonsync.sh @@ -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 diff --git a/ct/dashy.sh b/ct/dashy.sh index 67d42563..fc62084b 100644 --- a/ct/dashy.sh +++ b/ct/dashy.sh @@ -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 diff --git a/ct/debian.sh b/ct/debian.sh index b5898aaa..d36b6e82 100644 --- a/ct/debian.sh +++ b/ct/debian.sh @@ -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 <> $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 diff --git a/ct/docker.sh b/ct/docker.sh index 110a0b7c..a5e5096e 100644 --- a/ct/docker.sh +++ b/ct/docker.sh @@ -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 <> $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 diff --git a/ct/esphome.sh b/ct/esphome.sh index 52eacea5..06f9d513 100644 --- a/ct/esphome.sh +++ b/ct/esphome.sh @@ -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 <> $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 diff --git a/ct/grafana.sh b/ct/grafana.sh index de689df1..0e7244df 100644 --- a/ct/grafana.sh +++ b/ct/grafana.sh @@ -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 diff --git a/ct/homeassistant.sh b/ct/homeassistant.sh index 54afbe11..61e0eaf9 100644 --- a/ct/homeassistant.sh +++ b/ct/homeassistant.sh @@ -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 <> $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 diff --git a/ct/homebridge.sh b/ct/homebridge.sh index e4bd0871..8f6eb118 100644 --- a/ct/homebridge.sh +++ b/ct/homebridge.sh @@ -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 diff --git a/ct/influxdb.sh b/ct/influxdb.sh index 4bf9b405..119d2a4e 100644 --- a/ct/influxdb.sh +++ b/ct/influxdb.sh @@ -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 diff --git a/ct/mariadb.sh b/ct/mariadb.sh index 7776ba36..73e2134a 100644 --- a/ct/mariadb.sh +++ b/ct/mariadb.sh @@ -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 diff --git a/ct/motioneye.sh b/ct/motioneye.sh index 23332a38..92894a21 100644 --- a/ct/motioneye.sh +++ b/ct/motioneye.sh @@ -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 <> $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 diff --git a/ct/mqtt.sh b/ct/mqtt.sh index 315a9e9e..254f4619 100644 --- a/ct/mqtt.sh +++ b/ct/mqtt.sh @@ -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 diff --git a/ct/nginx-proxy-manager.sh b/ct/nginx-proxy-manager.sh index 3f51512d..670cbdcd 100644 --- a/ct/nginx-proxy-manager.sh +++ b/ct/nginx-proxy-manager.sh @@ -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 diff --git a/ct/node-red.sh b/ct/node-red.sh index b75eb47d..504ddc71 100644 --- a/ct/node-red.sh +++ b/ct/node-red.sh @@ -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 diff --git a/ct/photoprism.sh b/ct/photoprism.sh index ec2325ad..076aefef 100644 --- a/ct/photoprism.sh +++ b/ct/photoprism.sh @@ -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 <> $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 diff --git a/ct/pihole.sh b/ct/pihole.sh index 870c883c..2667f184 100644 --- a/ct/pihole.sh +++ b/ct/pihole.sh @@ -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 <> $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 diff --git a/ct/technitiumdns.sh b/ct/technitiumdns.sh index 7a66d1b8..15ffdf42 100644 --- a/ct/technitiumdns.sh +++ b/ct/technitiumdns.sh @@ -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 <> $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 diff --git a/ct/ubuntu.sh b/ct/ubuntu.sh index d187fb95..d24150a7 100644 --- a/ct/ubuntu.sh +++ b/ct/ubuntu.sh @@ -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 <> $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 diff --git a/ct/vaultwarden.sh b/ct/vaultwarden.sh index c81d099c..6e8c43b7 100644 --- a/ct/vaultwarden.sh +++ b/ct/vaultwarden.sh @@ -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 <> $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 diff --git a/ct/zigbee2mqtt.sh b/ct/zigbee2mqtt.sh index 0b0e222b..9d0edba5 100644 --- a/ct/zigbee2mqtt.sh +++ b/ct/zigbee2mqtt.sh @@ -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 diff --git a/ct/zwavejs2mqtt.sh b/ct/zwavejs2mqtt.sh index 9e66ab47..65034e6c 100644 --- a/ct/zwavejs2mqtt.sh +++ b/ct/zwavejs2mqtt.sh @@ -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