summaryrefslogtreecommitdiffstats
path: root/satellit_installer/includes/10-script_dropper.inc
diff options
context:
space:
mode:
authorChristian Rößler2015-02-25 14:58:13 +0100
committerChristian Rößler2015-02-25 14:58:13 +0100
commit28b92f337f7dbd4a3c7fce77416d18927100d97f (patch)
treed02218a3ae697357a704727bee08bc6b2af748f2 /satellit_installer/includes/10-script_dropper.inc
parent[SSPS] Begun moving div. functions to rc.local (diff)
downloadsetup-scripts-28b92f337f7dbd4a3c7fce77416d18927100d97f.tar.gz
setup-scripts-28b92f337f7dbd4a3c7fce77416d18927100d97f.tar.xz
setup-scripts-28b92f337f7dbd4a3c7fce77416d18927100d97f.zip
[SSPS] More functions moved to rc.local-started script [untested, keep care!]
Diffstat (limited to 'satellit_installer/includes/10-script_dropper.inc')
-rw-r--r--satellit_installer/includes/10-script_dropper.inc18
1 files changed, 10 insertions, 8 deletions
diff --git a/satellit_installer/includes/10-script_dropper.inc b/satellit_installer/includes/10-script_dropper.inc
index c1ccd7b..2178863 100644
--- a/satellit_installer/includes/10-script_dropper.inc
+++ b/satellit_installer/includes/10-script_dropper.inc
@@ -11,9 +11,10 @@ drop_script() {
mkdir -p "/root/installer"
# So we know all the paths and the mysql password
cat "${BASEDIR}/includes/00-dirs.inc" "${CONFIGDIR}/config" > "/root/installer/config"
- chmod 0600 "/root/installer/config"
- cp "${BASEDIR}/static_files/firstrun_script.sh" "/root/installer/firstrun.sh"
- chmod u+x "/root/installer/firstrun.sh"
+ chmod 0600 /root/installer/config
+ cp "${BASEDIR}/static_files/firstrun_script.sh" "${BASEDIR}/static_files/rclocal_script.sh" /root/installer/
+ chmod u+x /root/installer/firstrun.sh /root/installer/rclocal_script.sh
+
}
drop_keychanger_rclocal() {
@@ -24,16 +25,17 @@ drop_keychanger_rclocal() {
echo "# Patching rc.local..."
cp -p /etc/rc.local /etc/rc.local.sik
cat > /etc/rc.local <<-HIERDOK
- echo
- echo "Deleting old ssh keys..."
+ #!/bin/bash
+ echo "rc.local started: $(date "+%Y-%m-%d %H:%m:%S")" >> /root/init.log
+ echo "Deleting old ssh keys..." >> /root/init.log
rm -f /etc/ssh/ssh_host_*key* 2>/dev/null
- echo "... done."
+ echo -n "... done."
- echo "Generating new ssh keys..."
+ echo "Generating new ssh keys..." >> /root/init.log
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."
+ echo -n "... done." >> /root/init.log
mv /etc/rc.local.sik /etc/rc.local
HIERDOK
chmod +x /etc/rc.local