Merge branch 'stretch' of https://github.com/bashrc/freedombone
This commit is contained in:
commit
806fd6aa06
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue