Don't duplicate the content in rc.local.

This commit is contained in:
cimryan
2018-10-24 19:18:38 -07:00
parent cdcb9cd920
commit b57d769062

View File

@@ -142,9 +142,6 @@ function configure_rc_local () {
echo "Configuring /etc/rc.local to run the archive scripts at startup..." echo "Configuring /etc/rc.local to run the archive scripts at startup..."
echo "#!/bin/bash -eu" > ~/rc.local echo "#!/bin/bash -eu" > ~/rc.local
# Get everything but the last two lines
tail -n +2 /etc/rc.local | sed '$d' >> ~/rc.local
echo "archiveserver=\"${archiveserver}\"" >> ~/rc.local echo "archiveserver=\"${archiveserver}\"" >> ~/rc.local
cat << 'EOF' >> ~/rc.local cat << 'EOF' >> ~/rc.local
LOGFILE=/tmp/rc.local.log LOGFILE=/tmp/rc.local.log
@@ -160,7 +157,7 @@ log "All done"
exit 0 exit 0
EOF EOF
cat ~/rc.local >> /etc/rc.local cat ~/rc.local > /etc/rc.local
rm ~/rc.local rm ~/rc.local
echo "Configured rc.local." echo "Configured rc.local."
} }