summaryrefslogtreecommitdiffstats
path: root/satellit_installer/includes/10-script_dropper.inc
diff options
context:
space:
mode:
authorroot2015-02-24 17:25:27 +0100
committerroot2015-02-24 17:25:27 +0100
commitb0c332f891b914d1d4efb7e3e0d489978dc87891 (patch)
treeee08f66918bc1f7324e54f5c3a583aae505c3ab0 /satellit_installer/includes/10-script_dropper.inc
parent[SSPS] Add sudoers rule for ldadp-setperms (diff)
downloadsetup-scripts-b0c332f891b914d1d4efb7e3e0d489978dc87891.tar.gz
setup-scripts-b0c332f891b914d1d4efb7e3e0d489978dc87891.tar.xz
setup-scripts-b0c332f891b914d1d4efb7e3e0d489978dc87891.zip
[SSPS] Begun moving div. functions to rc.local
Diffstat (limited to 'satellit_installer/includes/10-script_dropper.inc')
-rw-r--r--satellit_installer/includes/10-script_dropper.inc26
1 files changed, 26 insertions, 0 deletions
diff --git a/satellit_installer/includes/10-script_dropper.inc b/satellit_installer/includes/10-script_dropper.inc
index 4c6fb9e..c1ccd7b 100644
--- a/satellit_installer/includes/10-script_dropper.inc
+++ b/satellit_installer/includes/10-script_dropper.inc
@@ -16,7 +16,33 @@ drop_script() {
chmod u+x "/root/installer/firstrun.sh"
}
+drop_keychanger_rclocal() {
+ if grep -q "Deleting old ssh keys" /etc/rc.local; then
+ echo "# ssh key changer already in rc.local; doing nothing."
+ else
+ echo
+ echo "# Patching rc.local..."
+ cp -p /etc/rc.local /etc/rc.local.sik
+ cat > /etc/rc.local <<-HIERDOK
+ echo
+ echo "Deleting old ssh keys..."
+ rm -f /etc/ssh/ssh_host_*key* 2>/dev/null
+ echo "... done."
+
+ echo "Generating new ssh keys..."
+ ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N "" -t rsa -q
+ ssh-keygen -f /etc/ssh/ssh_host_dsa_key -N "" -t dsa -q
+ ssh-keygen -f /etc/ssh/ssh_host_ecdsa_key -N "" -t ecdsa -q
+ echo "... done."
+ mv /etc/rc.local.sik /etc/rc.local
+ HIERDOK
+ chmod +x /etc/rc.local
+ fi
+
+}
+
drop_firstrun_script () {
patch_profile
drop_script
+ drop_keychanger_rclocal
}