| 
									
										
										
										
											2024-01-15 16:47:30 +03:00
										 |  |  | #!/usr/bin/bash
 | 
					
						
							|  |  |  | #---------------------------------------------------------------------- | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | cd $(dirname $0) | 
					
						
							|  |  |  | PATH=$PATH:$(dirname "$(pwd)") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #---------------------------------------------------------------------- | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | source ../.pct-helpers | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-27 16:13:38 +03:00
										 |  |  | #---------------------------------------------------------------------- | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-27 16:39:44 +03:00
										 |  |  | need ifreload | 
					
						
							| 
									
										
										
										
											2024-01-27 16:13:38 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-15 16:47:30 +03:00
										 |  |  | #---------------------------------------------------------------------- | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | readConfig | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 15:32:56 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-27 16:13:38 +03:00
										 |  |  | DFL_WAN_PORT=${DFL_WAN_PORT:-enp5s0} | 
					
						
							|  |  |  | DFL_ADMIN_PORT=${DFL_ADMIN_PORT:-enp2s0} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | DFL_HOST_ADMIN_IP=${PROXMOX_ADMIN_IP:-10.0.0.254/24} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-27 16:39:44 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-15 16:47:30 +03:00
										 |  |  | SOFTWARE=( | 
					
						
							| 
									
										
										
										
											2024-01-27 16:39:44 +03:00
										 |  |  | 	ifupdown2 | 
					
						
							| 
									
										
										
										
											2024-01-15 16:47:30 +03:00
										 |  |  | 	make | 
					
						
							|  |  |  | 	w3m links | 
					
						
							| 
									
										
										
										
											2024-01-16 04:07:04 +03:00
										 |  |  | 	tree | 
					
						
							| 
									
										
										
										
											2024-01-15 16:47:30 +03:00
										 |  |  | 	qrencode | 
					
						
							|  |  |  | 	htop iftop iotop | 
					
						
							|  |  |  | 	tmux | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 15:32:56 +03:00
										 |  |  | INTERFACES=/etc/network/interfaces | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-21 13:50:47 +03:00
										 |  |  | BOOTSTRAP_PORT=${BOOTSTRAP_PORT:-none} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | BRIDGES_TPL=${BRIDGES_TPL:-bridges.tpl} | 
					
						
							| 
									
										
										
										
											2024-01-15 16:47:30 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-27 16:49:44 +03:00
										 |  |  | # XXX | 
					
						
							|  |  |  | #readVars | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-18 17:32:19 +03:00
										 |  |  | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 
					
						
							|  |  |  | # Bootstrap... | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 19:19:19 +03:00
										 |  |  | if ! [ -z $BOOTSTRAP_CLEAN ] ; then | 
					
						
							| 
									
										
										
										
											2024-10-19 15:32:56 +03:00
										 |  |  | 	@ cp "$INTERFACES"{,.bak} | 
					
						
							| 
									
										
										
										
											2024-10-19 19:19:19 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	# stage 1: bootstrap -> clean | 
					
						
							|  |  |  | 	if [ -e "$INTERFACES".clean ] ; then | 
					
						
							|  |  |  | 		@ mv "$INTERFACES"{.clean,.new} | 
					
						
							| 
									
										
										
										
											2024-10-19 21:52:42 +03:00
										 |  |  | 		DFL_UPDATE=SKIP | 
					
						
							|  |  |  | 		DFL_APPS=SKIP | 
					
						
							|  |  |  | 		DFL_BRIDGES=SKIP | 
					
						
							|  |  |  | 		DFL_HOSTS=SKIP | 
					
						
							|  |  |  | 		DFL_DNS=1 | 
					
						
							|  |  |  | 		DFL_FIREWALL=SKIP | 
					
						
							| 
									
										
										
										
											2024-10-19 22:05:19 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 19:19:19 +03:00
										 |  |  | 	# stage 2: clean -> final | 
					
						
							|  |  |  | 	elif [ -e "$INTERFACES".final ] ; then | 
					
						
							|  |  |  | 		@ mv "$INTERFACES"{.final,.new} | 
					
						
							| 
									
										
										
										
											2024-10-19 21:52:42 +03:00
										 |  |  | 		DFL_UPDATE=SKIP | 
					
						
							|  |  |  | 		DFL_APPS=SKIP | 
					
						
							|  |  |  | 		DFL_BRIDGES=SKIP | 
					
						
							|  |  |  | 		DFL_HOSTS=1 | 
					
						
							|  |  |  | 		DFL_DNS=SKIP | 
					
						
							|  |  |  | 		DFL_FIREWALL=1 | 
					
						
							| 
									
										
										
										
											2024-10-19 22:05:19 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-20 02:14:23 +03:00
										 |  |  | 		REBOOT=1 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 21:52:42 +03:00
										 |  |  | 	# done | 
					
						
							| 
									
										
										
										
											2024-10-19 19:19:19 +03:00
										 |  |  | 	else | 
					
						
							|  |  |  | 		exit | 
					
						
							|  |  |  | 	fi | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 15:32:56 +03:00
										 |  |  | 	if reviewApplyChanges "$INTERFACES" ; then | 
					
						
							|  |  |  | 		# XXX this must be done in nohup to avoid breaking on connection lost... | 
					
						
							|  |  |  | 		if ! @ ifreload -a ; then | 
					
						
							|  |  |  | 			# reset settings back if ifreload fails... | 
					
						
							|  |  |  | 			@ cp "$INTERFACES"{.bak,} | 
					
						
							|  |  |  | 			@ ifreload -a	 | 
					
						
							|  |  |  | 		fi | 
					
						
							|  |  |  | 	fi | 
					
						
							| 
									
										
										
										
											2024-10-18 17:32:19 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Bootstrap... | 
					
						
							| 
									
										
										
										
											2024-10-19 21:52:42 +03:00
										 |  |  | elif ! [ -z $BOOTSTRAP ] ; then | 
					
						
							| 
									
										
										
										
											2024-10-19 16:07:10 +03:00
										 |  |  | 	DFL_BOOTSTRAP_PORT=${DFL_BOOTSTRAP_PORT:-none} | 
					
						
							|  |  |  | 	xread "Bootstrap port: " BOOTSTRAP_PORT | 
					
						
							| 
									
										
										
										
											2024-10-19 15:09:34 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 15:32:56 +03:00
										 |  |  | 	BRIDGES_BOOTSTRAP_TPL=bootstrap-bridges.tpl | 
					
						
							| 
									
										
										
										
											2024-10-19 21:52:42 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	DFL_UPDATE=1 | 
					
						
							|  |  |  | 	DFL_APPS=1 | 
					
						
							|  |  |  | 	DFL_BRIDGES=1 | 
					
						
							|  |  |  | 	DFL_HOSTS=SKIP | 
					
						
							|  |  |  | 	DFL_DNS=SKIP | 
					
						
							|  |  |  | 	DFL_FIREWALL=SKIP | 
					
						
							| 
									
										
										
										
											2024-10-18 17:32:19 +03:00
										 |  |  | fi | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-15 16:47:30 +03:00
										 |  |  | #---------------------------------------------------------------------- | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 22:24:23 +03:00
										 |  |  | # System... | 
					
						
							| 
									
										
										
										
											2024-01-15 16:47:30 +03:00
										 |  |  | if xreadYes "# Update system?" UPDATE ; then | 
					
						
							|  |  |  | 	@ apt update | 
					
						
							|  |  |  | 	@ apt upgrade | 
					
						
							|  |  |  | fi | 
					
						
							| 
									
										
										
										
											2024-10-19 22:24:23 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Tools... | 
					
						
							| 
									
										
										
										
											2024-01-15 16:47:30 +03:00
										 |  |  | if xreadYes "# Install additional apps?" APPS ; then | 
					
						
							| 
									
										
										
										
											2024-01-31 03:40:16 +03:00
										 |  |  | 	@ apt install ${SOFTWARE[@]} | 
					
						
							| 
									
										
										
										
											2024-01-15 16:47:30 +03:00
										 |  |  | fi | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 22:24:23 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-31 17:26:58 +03:00
										 |  |  | # Bridges... | 
					
						
							| 
									
										
										
										
											2024-01-15 16:47:30 +03:00
										 |  |  | if xreadYes "# Create bridges?" BRIDGES ; then | 
					
						
							| 
									
										
										
										
											2024-01-27 16:13:38 +03:00
										 |  |  | 	xread "WAN port: " WAN_PORT  | 
					
						
							|  |  |  | 	xread "ADMIN port: " ADMIN_PORT  | 
					
						
							|  |  |  | 	xread "Host ADMIN IP: " HOST_ADMIN_IP | 
					
						
							|  |  |  | 	xread "Gate ADMIN IP: " GATE_ADMIN_IP | 
					
						
							| 
									
										
										
										
											2024-01-27 16:49:44 +03:00
										 |  |  | 	readBridgeVars | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-31 03:40:16 +03:00
										 |  |  | 	# check if new bridges already exist in interfaces... | 
					
						
							| 
									
										
										
										
											2024-08-06 02:39:27 +03:00
										 |  |  | 	if [ -e "$INTERFACES" ] \
 | 
					
						
							| 
									
										
										
										
											2024-01-31 03:40:16 +03:00
										 |  |  | 			&& grep -q \
 | 
					
						
							|  |  |  | 				"vmbr\(${WAN_BRIDGE}\|${LAN_BRIDGE}\|${ADMIN_BRIDGE}\)" \
 | 
					
						
							| 
									
										
										
										
											2024-08-06 02:39:27 +03:00
										 |  |  | 				"$INTERFACES" ; then | 
					
						
							| 
									
										
										
										
											2024-01-31 03:40:16 +03:00
										 |  |  | 		conflict= | 
					
						
							| 
									
										
										
										
											2024-10-17 12:38:40 +03:00
										 |  |  | 		#for br in WAN_BRIDGE LAN_BRIDGE ADMIN_BRIDGE ; do | 
					
						
							|  |  |  | 		for br in WAN_BRIDGE LAN_BRIDGE ; do | 
					
						
							| 
									
										
										
										
											2024-08-06 02:39:27 +03:00
										 |  |  | 			if grep -q "vmbr${!br}" "$INTERFACES" ; then | 
					
						
							| 
									
										
										
										
											2024-01-31 03:40:16 +03:00
										 |  |  | 				conflict="${conflict}, vmbr${!br} (${br})" | 
					
						
							|  |  |  | 			fi | 
					
						
							|  |  |  | 		done | 
					
						
							| 
									
										
										
										
											2024-10-17 12:49:48 +03:00
										 |  |  | 		if grep -q "vmbr${ADMIN_BRIDGE}" "$INTERFACES" ; then | 
					
						
							| 
									
										
										
										
											2024-10-17 12:38:40 +03:00
										 |  |  | 			echo "NOTE: reusing vmbr${ADMIN_BRIDGE} for ADMIN." | 
					
						
							| 
									
										
										
										
											2024-10-17 12:41:37 +03:00
										 |  |  | 		else | 
					
						
							|  |  |  | 			echo "ERROR: will not overwrite existing bridges: ${conflict:2}" >&2 | 
					
						
							|  |  |  | 			exit 1 | 
					
						
							| 
									
										
										
										
											2024-10-17 12:38:40 +03:00
										 |  |  | 		fi | 
					
						
							| 
									
										
										
										
											2024-01-31 03:40:16 +03:00
										 |  |  | 	fi | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-06 02:39:27 +03:00
										 |  |  | 	@ cp "$INTERFACES"{,.bak} | 
					
						
							|  |  |  | 	@ cp "$INTERFACES"{,.new} | 
					
						
							| 
									
										
										
										
											2024-01-27 16:13:38 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-31 03:40:16 +03:00
										 |  |  | 	BRIDGES="$(\
 | 
					
						
							| 
									
										
										
										
											2024-10-17 12:19:42 +03:00
										 |  |  | 		cat "$BRIDGES_TPL" \
 | 
					
						
							| 
									
										
										
										
											2024-08-06 01:37:44 +03:00
										 |  |  | 			| expandPCTTemplate \
 | 
					
						
							| 
									
										
										
										
											2024-10-19 15:52:19 +03:00
										 |  |  | 				LAN_BRIDGE WAN_BRIDGE ADMIN_BRIDGE BOOTSTRAP_BRIDGE \
 | 
					
						
							| 
									
										
										
										
											2024-10-19 15:09:34 +03:00
										 |  |  | 				WAN_PORT ADMIN_PORT BOOTSTRAP_ADMIN_PORT \
 | 
					
						
							| 
									
										
										
										
											2024-08-06 01:37:44 +03:00
										 |  |  | 				HOST_ADMIN_IP GATE_ADMIN_IP)"
 | 
					
						
							| 
									
										
										
										
											2024-01-31 03:10:40 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 15:32:56 +03:00
										 |  |  | 	[ -z $BRIDGES_BOOTSTRAP_TPL ] \
 | 
					
						
							|  |  |  | 		|| BRIDGES_BOOTSTRAP="$(\
 | 
					
						
							|  |  |  | 			cat "$BRIDGES_BOOTSTRAP_TPL" \
 | 
					
						
							|  |  |  | 				| expandPCTTemplate \
 | 
					
						
							| 
									
										
										
										
											2024-10-19 15:52:19 +03:00
										 |  |  | 					LAN_BRIDGE WAN_BRIDGE ADMIN_BRIDGE BOOTSTRAP_BRIDGE \
 | 
					
						
							| 
									
										
										
										
											2024-10-19 16:08:31 +03:00
										 |  |  | 					WAN_PORT ADMIN_PORT BOOTSTRAP_PORT \
 | 
					
						
							| 
									
										
										
										
											2024-10-19 15:32:56 +03:00
										 |  |  | 					HOST_ADMIN_IP GATE_ADMIN_IP)"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-31 17:26:58 +03:00
										 |  |  | 	if [ -z "$DRY_RUN" ] ; then | 
					
						
							| 
									
										
										
										
											2024-10-19 15:32:56 +03:00
										 |  |  | 		# write both bootstrap and clean bridge configurations... | 
					
						
							|  |  |  | 		if ! [ -z $BRIDGES_BOOTSTRAP ] ; then | 
					
						
							| 
									
										
										
										
											2024-10-19 18:40:53 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 			# interfaces.final | 
					
						
							|  |  |  | 			@ cp "$INTERFACES"{.new,.final} | 
					
						
							|  |  |  | 			@ sed -i \
 | 
					
						
							|  |  |  | 				-e 's/'$ADMIN_PORT'/'$BOOTSTRAP_PORT'/' \
 | 
					
						
							| 
									
										
										
										
											2024-10-19 18:46:54 +03:00
										 |  |  | 				-e '/^.*gateway .*$/d' \
 | 
					
						
							| 
									
										
										
										
											2024-10-19 18:40:53 +03:00
										 |  |  | 				"$INTERFACES".final | 
					
						
							|  |  |  | 			echo "$BRIDGES" \
 | 
					
						
							|  |  |  | 				>> "$INTERFACES".final | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			# interfaces.clean | 
					
						
							| 
									
										
										
										
											2024-10-19 15:32:56 +03:00
										 |  |  | 			@ cp "$INTERFACES"{.new,.clean} | 
					
						
							| 
									
										
										
										
											2024-10-19 16:03:35 +03:00
										 |  |  | 			@ sed -i \
 | 
					
						
							| 
									
										
										
										
											2024-10-19 18:51:29 +03:00
										 |  |  | 				-e '/^.*gateway .*$/d' \
 | 
					
						
							| 
									
										
										
										
											2024-10-19 16:03:35 +03:00
										 |  |  | 				"$INTERFACES".clean | 
					
						
							| 
									
										
										
										
											2024-10-19 18:28:58 +03:00
										 |  |  | 			echo "$BRIDGES" \
 | 
					
						
							|  |  |  | 				| sed \
 | 
					
						
							|  |  |  | 					-e 's/'$ADMIN_PORT'/'$BOOTSTRAP_PORT'/' \
 | 
					
						
							|  |  |  | 				>> "$INTERFACES".clean | 
					
						
							| 
									
										
										
										
											2024-10-19 18:40:53 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 			# interfaces.new (prep) | 
					
						
							| 
									
										
										
										
											2024-10-19 18:12:36 +03:00
										 |  |  | 			BRIDGES=$(\
 | 
					
						
							|  |  |  | 				echo "$BRIDGES_BOOTSTRAP" \
 | 
					
						
							| 
									
										
										
										
											2024-10-19 18:49:23 +03:00
										 |  |  | 					| sed -e '/^.*gateway .*$/d') | 
					
						
							| 
									
										
										
										
											2024-10-19 15:32:56 +03:00
										 |  |  | 		fi | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 18:40:53 +03:00
										 |  |  | 		# interfaces.new | 
					
						
							| 
									
										
										
										
											2024-08-06 02:39:27 +03:00
										 |  |  | 		echo "$BRIDGES" >> "$INTERFACES".new | 
					
						
							| 
									
										
										
										
											2024-10-19 15:32:56 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-06 01:57:40 +03:00
										 |  |  | 	else | 
					
						
							|  |  |  | 		echo "$BRIDGES" | 
					
						
							| 
									
										
										
										
											2024-01-31 17:26:58 +03:00
										 |  |  | 	fi | 
					
						
							| 
									
										
										
										
											2024-01-27 16:13:38 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 18:40:53 +03:00
										 |  |  | 	# interfaces | 
					
						
							| 
									
										
										
										
											2024-08-06 02:39:27 +03:00
										 |  |  | 	if reviewApplyChanges "$INTERFACES" ; then | 
					
						
							| 
									
										
										
										
											2024-10-19 15:32:56 +03:00
										 |  |  | 		# XXX this must be done in nohup to avoid breaking on connection lost... | 
					
						
							| 
									
										
										
										
											2024-08-06 02:33:37 +03:00
										 |  |  | 		if ! @ ifreload -a ; then | 
					
						
							|  |  |  | 			# reset settings back if ifreload fails... | 
					
						
							| 
									
										
										
										
											2024-08-06 02:39:27 +03:00
										 |  |  | 			@ cp "$INTERFACES"{.bak,} | 
					
						
							| 
									
										
										
										
											2024-08-06 02:33:37 +03:00
										 |  |  | 			@ ifreload -a	 | 
					
						
							|  |  |  | 		fi | 
					
						
							| 
									
										
										
										
											2024-01-27 16:39:44 +03:00
										 |  |  | 	fi | 
					
						
							| 
									
										
										
										
											2024-01-15 16:47:30 +03:00
										 |  |  | fi | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-31 17:26:58 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 21:32:42 +03:00
										 |  |  | # /etc/hosts | 
					
						
							|  |  |  | if xreadYes "# Update /etc/hosts?" HOSTS ; then | 
					
						
							|  |  |  | 	@ cp /etc/hosts{,.bak} | 
					
						
							|  |  |  | 	@ cp /etc/hosts{,.new} | 
					
						
							|  |  |  | 	@ sed -i \
 | 
					
						
							| 
									
										
										
										
											2024-10-19 21:52:42 +03:00
										 |  |  | 		-e 's/^[^#].* \(pve.local.*\)$/'${HOST_ADMIN_IP/\/*}' \1/' \
 | 
					
						
							| 
									
										
										
										
											2024-10-19 21:32:42 +03:00
										 |  |  | 		/etc/hosts.new | 
					
						
							|  |  |  | 	reviewApplyChanges /etc/hosts | 
					
						
							|  |  |  | fi | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 22:05:19 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 22:24:23 +03:00
										 |  |  | # build only if we need to... | 
					
						
							|  |  |  | build(){ | 
					
						
							|  |  |  | 	if [ -z $__ASSETS ] ; then | 
					
						
							|  |  |  | 		__ASSETS=1 | 
					
						
							|  |  |  | 		echo "# Building config templates..." | 
					
						
							|  |  |  | 		buildAssets | 
					
						
							|  |  |  | 	fi | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-31 17:26:58 +03:00
										 |  |  | # DNS | 
					
						
							|  |  |  | if xreadYes "# Update DNS?" DNS ; then | 
					
						
							| 
									
										
										
										
											2024-10-19 22:24:23 +03:00
										 |  |  | 	build | 
					
						
							| 
									
										
										
										
											2024-01-31 17:26:58 +03:00
										 |  |  | 	file=/etc/resolv.conf | 
					
						
							|  |  |  | 	@ cp "staging/${file}" "${file}".new | 
					
						
							|  |  |  | 	reviewApplyChanges "${file}" | 
					
						
							|  |  |  | fi | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-15 16:47:30 +03:00
										 |  |  | # Firewall | 
					
						
							| 
									
										
										
										
											2024-01-15 16:59:06 +03:00
										 |  |  | if xreadYes "# Update firewall rules?" FIREWALL ; then | 
					
						
							| 
									
										
										
										
											2024-10-19 22:24:23 +03:00
										 |  |  | 	build | 
					
						
							| 
									
										
										
										
											2024-01-31 17:26:58 +03:00
										 |  |  | 	file=/etc/pve/firewall/cluster.fw | 
					
						
							|  |  |  | 	@ cp "staging/${file}" "${file}".new | 
					
						
							|  |  |  | 	reviewApplyChanges "${file}" | 
					
						
							| 
									
										
										
										
											2024-01-15 16:47:30 +03:00
										 |  |  | fi | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-31 17:26:58 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-26 03:06:55 +03:00
										 |  |  | showNotes | 
					
						
							|  |  |  | echo "# Done." | 
					
						
							| 
									
										
										
										
											2024-01-15 16:47:30 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-20 02:16:27 +03:00
										 |  |  | if ! [ -z $REBOOT ] ; then | 
					
						
							|  |  |  | 	echo "# Rebooting..." | 
					
						
							|  |  |  | 	@ reboot | 
					
						
							|  |  |  | fi | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-15 16:47:30 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | #---------------------------------------------------------------------- | 
					
						
							|  |  |  | # vim:set ts=4 sw=4 : |