re-arranging before interface config refactor
This commit is contained in:
parent
1f58cd3918
commit
4a89aa2c93
|
@ -48,9 +48,13 @@ case "$1" in
|
||||||
## START writing config files
|
## START writing config files
|
||||||
|
|
||||||
|
|
||||||
# disable password logins on ssh
|
# write udev rules for device names
|
||||||
sed -i -e '/#*\s*PasswordAuthentication /d' /etc/ssh/sshd_config
|
for if in ${!MACS[@]}
|
||||||
echo "PasswordAuthentication no" >>/etc/ssh/sshd_config
|
do
|
||||||
|
ifmac=${MACS[$if]}
|
||||||
|
[ "$if" == "mgmt" ] && if=mgmt1
|
||||||
|
[ -z "$ifmac" ] || echo 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=='$ifmac', ATTR{type}=="1", NAME="'${if}'"'
|
||||||
|
done >/etc/udev/rules.d/70-persistent-net.rules
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -99,25 +103,12 @@ case "$1" in
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# set ipsec config
|
# set ipsec config
|
||||||
sed -i -e "s/FQHOSTNAME/${HOSTNAME}/" /etc/ipsec.conf.wit
|
sed -i -e "s/FQHOSTNAME/${HOSTNAME}/" /etc/ipsec.conf.wit
|
||||||
echo ": RSA ${HOSTNAME}.key" >/etc/ipsec.secrets
|
echo ": RSA ${HOSTNAME}.key" >/etc/ipsec.secrets
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# write udev rules for device names
|
|
||||||
for if in ${!MACS[@]}
|
|
||||||
do
|
|
||||||
ifmac=${MACS[$if]}
|
|
||||||
[ "$if" == "mgmt" ] && if=mgmt1
|
|
||||||
[ -z "$ifmac" ] || echo 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=='$ifmac', ATTR{type}=="1", NAME="'${if}'"'
|
|
||||||
done >/etc/udev/rules.d/70-persistent-net.rules
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# wite grub rules for serial terminal
|
# wite grub rules for serial terminal
|
||||||
sed -i -e '/GRUB_CMDLINE_LINUX_DEFAULT=/d' -e '/GRUB_CMDLINE_LINUX=/d' -e '/GRUB_SERIAL_COMMAND=/d' -e '/GRUB_TERMINAL=/d' /etc/default/grub
|
sed -i -e '/GRUB_CMDLINE_LINUX_DEFAULT=/d' -e '/GRUB_CMDLINE_LINUX=/d' -e '/GRUB_SERIAL_COMMAND=/d' -e '/GRUB_TERMINAL=/d' /etc/default/grub
|
||||||
cat <<-EOF >>/etc/default/grub
|
cat <<-EOF >>/etc/default/grub
|
||||||
|
@ -128,6 +119,11 @@ case "$1" in
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
||||||
|
# disable password logins on ssh
|
||||||
|
sed -i -e '/#*\s*PasswordAuthentication /d' /etc/ssh/sshd_config
|
||||||
|
echo "PasswordAuthentication no" >>/etc/ssh/sshd_config
|
||||||
|
|
||||||
|
|
||||||
## END config file section
|
## END config file section
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue