summaryrefslogtreecommitdiffstats
path: root/satellit_installer/includes/10-script_dropper.inc
blob: a991f282545213daf51c3c134646604de79b7f9e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
fb_enable_firstrun() {
	local script="/opt/openslx/firstrun.sh"
	[ -x "$script" ] || perror "Firstrun script not found ($script)"
	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
}

fb_write_config() {
	# So we know all the paths
	declare -p DMSDDIR TASKMANDIR SLXADMINDIR VERSION >> "$CONFIG_FILE"
}

enable_firstrun_script () {
	fb_enable_firstrun
	fb_write_config
	systemctl daemon-reload
	systemctl enable firstboot.service || perror "Could not enable firstboot service"
}