mirror of https://github.com/tteck/Proxmox.git
				
				
				
			
							parent
							
								
									4dc248cfe4
								
							
						
					
					
						commit
						9ac80e6ebe
					
				| 
						 | 
					@ -97,8 +97,10 @@ function default_settings() {
 | 
				
			||||||
  MAC=""
 | 
					  MAC=""
 | 
				
			||||||
  echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
 | 
					  echo -e "${DGN}Using VLAN Tag: ${BGN}Default${CL}"
 | 
				
			||||||
  VLAN=""
 | 
					  VLAN=""
 | 
				
			||||||
    echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
 | 
					  echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
 | 
				
			||||||
  SSH="no"
 | 
					  SSH="no"
 | 
				
			||||||
 | 
					  echo -e "${DGN}(ZFS) Enable Fuse Overlayfs: ${BGN}No${CL}"
 | 
				
			||||||
 | 
					  FUSE="no"
 | 
				
			||||||
  echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
 | 
					  echo -e "${DGN}Enable Verbose Mode: ${BGN}No${CL}"
 | 
				
			||||||
  VERB="no"
 | 
					  VERB="no"
 | 
				
			||||||
  echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 | 
					  echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 | 
				
			||||||
| 
						 | 
					@ -250,6 +252,13 @@ function advanced_settings() {
 | 
				
			||||||
      echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
 | 
					      echo -e "${DGN}Enable Root SSH Access: ${BGN}No${CL}"
 | 
				
			||||||
      SSH="no"
 | 
					      SSH="no"
 | 
				
			||||||
  fi
 | 
					  fi
 | 
				
			||||||
 | 
					  if (whiptail --defaultno --title "FUSE OVERLAYFS" --yesno "(ZFS) Enable Fuse Overlayfs?" 10 58); then
 | 
				
			||||||
 | 
					      echo -e "${DGN}(ZFS) Enable Fuse Overlayfs: ${BGN}Yes${CL}"
 | 
				
			||||||
 | 
					      FUSE="yes"
 | 
				
			||||||
 | 
					  else
 | 
				
			||||||
 | 
					      echo -e "${DGN}(ZFS) Enable Fuse Overlayfs: ${BGN}No${CL}"
 | 
				
			||||||
 | 
					      FUSE="no"
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
  if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
 | 
					  if (whiptail --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
 | 
				
			||||||
      echo -e "${DGN}Enable Verbose Mode: ${BGN}Yes${CL}"
 | 
					      echo -e "${DGN}Enable Verbose Mode: ${BGN}Yes${CL}"
 | 
				
			||||||
      VERB="yes"
 | 
					      VERB="yes"
 | 
				
			||||||
| 
						 | 
					@ -280,13 +289,14 @@ function start_script() {
 | 
				
			||||||
clear
 | 
					clear
 | 
				
			||||||
start_script
 | 
					start_script
 | 
				
			||||||
if [ "$VERB" == "yes" ]; then set -x; fi
 | 
					if [ "$VERB" == "yes" ]; then set -x; fi
 | 
				
			||||||
if [ "$CT_TYPE" == "1" ]; then
 | 
					if [ "$FUSE" == "yes" ]; then 
 | 
				
			||||||
  FEATURES="nesting=1,keyctl=1"
 | 
					FEATURES="fuse=1,keyctl=1,nesting=1"
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
  FEATURES="nesting=1"
 | 
					FEATURES="keyctl=1,nesting=1" 
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
TEMP_DIR=$(mktemp -d)
 | 
					TEMP_DIR=$(mktemp -d)
 | 
				
			||||||
pushd $TEMP_DIR >/dev/null
 | 
					pushd $TEMP_DIR >/dev/null
 | 
				
			||||||
 | 
					export ST=$FUSE
 | 
				
			||||||
export VERBOSE=$VERB
 | 
					export VERBOSE=$VERB
 | 
				
			||||||
export SSH_ROOT=${SSH}
 | 
					export SSH_ROOT=${SSH}
 | 
				
			||||||
export CTID=$CT_ID
 | 
					export CTID=$CT_ID
 | 
				
			||||||
| 
						 | 
					@ -307,10 +317,13 @@ export PCT_OPTIONS="
 | 
				
			||||||
"
 | 
					"
 | 
				
			||||||
bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
 | 
					bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit
 | 
				
			||||||
LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
 | 
					LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
 | 
				
			||||||
if [ "$CT_TYPE" == "0" ]; then
 | 
					cat <<EOF >>$LXC_CONFIG
 | 
				
			||||||
  cat <<EOF >>$LXC_CONFIG
 | 
					 | 
				
			||||||
lxc.cgroup2.devices.allow: a
 | 
					lxc.cgroup2.devices.allow: a
 | 
				
			||||||
lxc.cap.drop:
 | 
					lxc.cap.drop:
 | 
				
			||||||
 | 
					EOF
 | 
				
			||||||
 | 
					if [ "$CT_TYPE" == "0" ]; then
 | 
				
			||||||
 | 
					LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
 | 
				
			||||||
 | 
					cat <<EOF >>$LXC_CONFIG
 | 
				
			||||||
lxc.cgroup2.devices.allow: c 188:* rwm
 | 
					lxc.cgroup2.devices.allow: c 188:* rwm
 | 
				
			||||||
lxc.cgroup2.devices.allow: c 189:* rwm
 | 
					lxc.cgroup2.devices.allow: c 189:* rwm
 | 
				
			||||||
lxc.mount.entry: /dev/serial/by-id  dev/serial/by-id  none bind,optional,create=dir
 | 
					lxc.mount.entry: /dev/serial/by-id  dev/serial/by-id  none bind,optional,create=dir
 | 
				
			||||||
| 
						 | 
					@ -319,11 +332,6 @@ lxc.mount.entry: /dev/ttyUSB1       dev/ttyUSB1       none bind,optional,create=
 | 
				
			||||||
lxc.mount.entry: /dev/ttyACM0       dev/ttyACM0       none bind,optional,create=file
 | 
					lxc.mount.entry: /dev/ttyACM0       dev/ttyACM0       none bind,optional,create=file
 | 
				
			||||||
lxc.mount.entry: /dev/ttyACM1       dev/ttyACM1       none bind,optional,create=file
 | 
					lxc.mount.entry: /dev/ttyACM1       dev/ttyACM1       none bind,optional,create=file
 | 
				
			||||||
EOF
 | 
					EOF
 | 
				
			||||||
else
 | 
					 | 
				
			||||||
  cat <<EOF >>$LXC_CONFIG
 | 
					 | 
				
			||||||
lxc.cgroup2.devices.allow: a
 | 
					 | 
				
			||||||
lxc.cap.drop:
 | 
					 | 
				
			||||||
EOF
 | 
					 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
msg_info "Starting LXC Container"
 | 
					msg_info "Starting LXC Container"
 | 
				
			||||||
pct start $CTID
 | 
					pct start $CTID
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue