summaryrefslogtreecommitdiffstats
path: root/satellit_installer/includes/10-script_dropper.inc
blob: 11ab9b9990dbb8b3a3bbf89d9abff2a4e04a5134 (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" "$script"
	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"
}