summaryrefslogblamecommitdiffstats
path: root/satellit_installer/includes/50-install_ldadp.inc
blob: 6fe1e699e273ff3bb038103b8dec5c18e037d365 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                                                                                                      












                                                                                                    


                
install_ldadp() {
	# $1: directory to install server to
	local DIR="$1"
	[ -z "$DIR" ] && perror "Pass dir to install_ldadp!"
	echo "# Installing ldadp... "
	git clone --depth 1 git://git.openslx.org/openslx-ng/ldadp.git ldadptmp || perror "Could not clone ldadp repo"
	cd ldadptmp || perror "Could not cd to ldadptmp"
	make || perror "Could not compile ldadp"
	mkdir -p "$DIR" || perror "Could not create $DIR"
	cp ldadp "$DIR" || perror "Could not copy ldadp binary to $DIR"
	cd .. || perror "Could not cd .."
	rm -r ldadptmp # Should we care if fail?

	# Static files
	install_files "ldadp"

	# ldadp dirs
	mkdir -p "$LDADPDIR" "$LDADPDIR/configs" || perror "Creating ldadp directories failed"
	chmod 755 "$LDADPDIR"
	chown root:root "$LDADPDIR"				# Prob. unnecessary, but to be sure.
	chmod 750 "$LDADPDIR/configs"
	chown -R taskmanager:ldadp "$LDADPDIR/configs"
	# Make sure we spare the binary
	chown root:root "$LDADPDIR/ldadp"			# ... not the binary.

	return 0
}