This commit is contained in:
Bob Mottram 2017-12-26 21:52:33 +00:00
commit 806fd6aa06
2 changed files with 41 additions and 1 deletions

View File

@ -358,6 +358,10 @@ setup_apps $command_options
setup_final
echo ''
echo "${PROJECT_NAME} installation is complete"
echo $"${PROJECT_NAME} installation is complete."
echo ''
echo $'The default fbone user will be deleted when the system restarts.'
echo $'Next time you login use the username you gave during the install.'
echo ''
exit 0

View File

@ -91,10 +91,46 @@ function update_installed_apps_list {
cat $COMPLETION_FILE | grep "install_" > /usr/share/${PROJECT_NAME}/installed.txt
}
function create_default_user_removal_daemon {
# This daemon runs on first boot and removes the default fbone user
first_start_daemon_filename=/etc/systemd/system/firststart.service
first_start_script=/usr/local/bin/firststart
echo '#!/bin/bash' > $first_start_script
echo 'if [ -d /home/fbone]; then' >> $first_start_script
echo ' userdel -r fbone' >> $first_start_script
echo ' if [ -d /home/fbone]; then' >> $first_start_script
echo ' rm -rf /home/fbone' >> $first_start_script
echo ' fi' >> $first_start_script
echo 'fi' >> $first_start_script
echo 'systemctl disable firststart' >> $first_start_script
echo "rm $first_start_daemon_filename" >> $first_start_script
chmod +x $first_start_script
echo '[Unit]' > $first_start_daemon_filename
echo 'Description=Daemon run on first boot' >> $first_start_daemon_filename
echo 'After=syslog.target' >> $first_start_daemon_filename
echo 'After=network.target' >> $first_start_daemon_filename
echo '' >> $first_start_daemon_filename
echo '[Service]' >> $first_start_daemon_filename
echo 'User=root' >> $first_start_daemon_filename
echo 'Group=root' >> $first_start_daemon_filename
echo "ExecStart=$first_start_script" >> $first_start_daemon_filename
echo 'StandardOutput=syslog' >> $first_start_daemon_filename
echo 'StandardError=syslog' >> $first_start_daemon_filename
echo '' >> $first_start_daemon_filename
echo '[Install]' >> $first_start_daemon_filename
echo 'WantedBy=multi-user.target' >> $first_start_daemon_filename
systemctl enable firststart
}
function setup_final {
function_check update_installed_apps_list
update_installed_apps_list
function_check create_default_user_removal_daemon
create_default_user_removal_daemon
function_check install_tripwire
install_tripwire