summaryrefslogtreecommitdiffstats
path: root/satellit_installer/includes/10-script_dropper.inc
diff options
context:
space:
mode:
Diffstat (limited to 'satellit_installer/includes/10-script_dropper.inc')
-rw-r--r--satellit_installer/includes/10-script_dropper.inc27
1 files changed, 12 insertions, 15 deletions
diff --git a/satellit_installer/includes/10-script_dropper.inc b/satellit_installer/includes/10-script_dropper.inc
index 62d1b58..a991f28 100644
--- a/satellit_installer/includes/10-script_dropper.inc
+++ b/satellit_installer/includes/10-script_dropper.inc
@@ -1,24 +1,21 @@
-patch_profile() {
- local script="/root/installer/firstrun_script.sh"
+fb_enable_firstrun() {
+ local script="/opt/openslx/firstrun.sh"
[ -x "$script" ] || perror "Firstrun script not found ($script)"
- if grep -qF "$script" /root/.profile; then
- echo "# first_run script already in root's .profile, doing nothing."
- else
- echo "# Patching root's .profile"
- echo "$script" >> /root/.profile
+ if ! grep -qF "$script" "/home/openslx/.profile"; then
+ echo "# Patching openslx's .profile"
+ echo "[ -t 0 ] && $script" >> "/home/openslx/.profile"
+ chown openslx:openslx "/home/openslx/.profile"
fi
}
-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
+fb_write_config() {
+ # So we know all the paths
+ declare -p DMSDDIR TASKMANDIR SLXADMINDIR VERSION >> "$CONFIG_FILE"
}
-drop_firstrun_script () {
- patch_profile
- drop_script
+enable_firstrun_script () {
+ fb_enable_firstrun
+ fb_write_config
systemctl daemon-reload
systemctl enable firstboot.service || perror "Could not enable firstboot service"
}