mirror of
https://github.com/flynx/proxmox-utils.git
synced 2025-12-17 17:11:47 +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,}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
37
host/make.sh
37
host/make.sh
@ -52,7 +52,7 @@ if xreadYes "# Install additional apps?" APPS ; then
|
|||||||
@ apt install ${SOFTWARE[@]}
|
@ apt install ${SOFTWARE[@]}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Networking
|
# Bridges...
|
||||||
# XXX need to:
|
# XXX need to:
|
||||||
# - bootstrap this
|
# - bootstrap this
|
||||||
# - setup the gate, ssh, and wireguard
|
# - setup the gate, ssh, and wireguard
|
||||||
@ -88,25 +88,40 @@ if xreadYes "# Create bridges?" BRIDGES ; then
|
|||||||
cat bridges.tpl \
|
cat bridges.tpl \
|
||||||
| expandPCTTemplate WAN_PORT ADMIN_PORT)"
|
| expandPCTTemplate WAN_PORT ADMIN_PORT)"
|
||||||
|
|
||||||
# XXX add $BRIDGES to /etc/network/interfaces either before the
|
if [ -z "$DRY_RUN" ] ; then
|
||||||
# source command or at the end...
|
# XXX add $BRIDGES to /etc/network/interfaces either before the
|
||||||
# XXX
|
# source command or at the end...
|
||||||
|
# XXX
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
|
||||||
# review/apply setup...
|
if reviewApplyChanges /etc/network/interfaces ; then
|
||||||
echo "# Review updated: /etc/network/interfaces.new:"
|
|
||||||
@ cat /etc/network/interfaces.new
|
|
||||||
echo
|
|
||||||
if xreadYes "# Apply changes?" ; then
|
|
||||||
@ mv -b /etc/network/interfaces{.new,}
|
|
||||||
@ ifreload -a
|
@ ifreload -a
|
||||||
fi
|
fi
|
||||||
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
|
# Firewall
|
||||||
if xreadYes "# Update firewall rules?" FIREWALL ; then
|
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
|
fi
|
||||||
|
|
||||||
|
|
||||||
showNotes
|
showNotes
|
||||||
echo "# Done."
|
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