mirror of
https://github.com/flynx/proxmox-utils.git
synced 2025-12-17 09:01:49 +00:00
added dns config + refactoring...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
b079498481
commit
306f0ddc4c
35
.pct-helpers
35
.pct-helpers
@ -286,6 +286,41 @@ xreadpass(){
|
||||
}
|
||||
|
||||
|
||||
# Review changes in PATH.new, then edit/apply changes to PATH
|
||||
#
|
||||
# reviewApplyChanges PATH
|
||||
#
|
||||
# NOTE: if changes are not applied this will return non-zero making this
|
||||
# usable in conditionals...
|
||||
reviewApplyChanges(){
|
||||
local file=$1
|
||||
echo "# Review updated: ${file}.new:"
|
||||
@ cat ${file}.new
|
||||
echo
|
||||
# XXX add option to edit...
|
||||
local res
|
||||
while true ; do
|
||||
read -ep "# [a]pply, [e]dit, [s]kip? " res
|
||||
case "${res,,}" in
|
||||
a|apply)
|
||||
break
|
||||
;;
|
||||
e|edit)
|
||||
${EDITOR} "${file}"
|
||||
;;
|
||||
s|skip)
|
||||
echo "# file saved as: ${file}.new"
|
||||
return 1
|
||||
;;
|
||||
*)
|
||||
echo "ERROR: unknown command: \"$res\"" >&2
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
done
|
||||
@ mv -b "${file}"{.new,}
|
||||
}
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
|
||||
31
host/make.sh
31
host/make.sh
@ -52,7 +52,7 @@ if xreadYes "# Install additional apps?" APPS ; then
|
||||
@ apt install ${SOFTWARE[@]}
|
||||
fi
|
||||
|
||||
# Networking
|
||||
# Bridges...
|
||||
# XXX need to:
|
||||
# - bootstrap this
|
||||
# - setup the gate, ssh, and wireguard
|
||||
@ -88,25 +88,40 @@ if xreadYes "# Create bridges?" BRIDGES ; then
|
||||
cat bridges.tpl \
|
||||
| expandPCTTemplate WAN_PORT ADMIN_PORT)"
|
||||
|
||||
if [ -z "$DRY_RUN" ] ; then
|
||||
# XXX add $BRIDGES to /etc/network/interfaces either before the
|
||||
# source command or at the end...
|
||||
# XXX
|
||||
|
||||
# review/apply setup...
|
||||
echo "# Review updated: /etc/network/interfaces.new:"
|
||||
@ cat /etc/network/interfaces.new
|
||||
echo
|
||||
if xreadYes "# Apply changes?" ; then
|
||||
@ mv -b /etc/network/interfaces{.new,}
|
||||
fi
|
||||
|
||||
if reviewApplyChanges /etc/network/interfaces ; then
|
||||
@ ifreload -a
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
echo "# Building config..."
|
||||
# XXX do we need any extra vars here???
|
||||
buildAssets
|
||||
|
||||
|
||||
# DNS
|
||||
if xreadYes "# Update DNS?" DNS ; then
|
||||
file=/etc/resolv.conf
|
||||
@ cp "staging/${file}" "${file}".new
|
||||
reviewApplyChanges "${file}"
|
||||
fi
|
||||
|
||||
|
||||
# Firewall
|
||||
if xreadYes "# Update firewall rules?" FIREWALL ; then
|
||||
@ cp --backup -i templates/etc/pve/firewall/cluster.fw /etc/pve/firewall/
|
||||
file=/etc/pve/firewall/cluster.fw
|
||||
@ cp "staging/${file}" "${file}".new
|
||||
reviewApplyChanges "${file}"
|
||||
fi
|
||||
|
||||
|
||||
showNotes
|
||||
echo "# Done."
|
||||
|
||||
|
||||
4
host/templates/etc/resolv.conf
Normal file
4
host/templates/etc/resolv.conf
Normal file
@ -0,0 +1,4 @@
|
||||
search srv
|
||||
nameserver 127.0.0.1
|
||||
nameserver ${NS_ADMIN_IPn}
|
||||
nameserver 8.8.8.8
|
||||
Loading…
x
Reference in New Issue
Block a user