forked from cobbler/cobbler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
distro_build_configs.sh
54 lines (49 loc) · 1.43 KB
/
distro_build_configs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
export DOCPATH="share/man"
export ETCPATH="/etc/cobbler"
export LIBPATH="/var/lib/cobbler"
export LOGPATH="/var/log"
export COMPLETION_PATH="/usr/share/bash-completion/completions"
export STATEPATH="/tmp/cobbler_settings/devinstall"
export HTTPD_SERVICE="apache2.service"
export WEBROOT="/srv/www";
export WEBCONFIG="/etc/apache2/vhosts.d";
export WEBROOTCONFIG="/etc/apache2";
export TFTPROOT="/srv/tftpboot"
export DEFAULTPATH="etc/sysconfig"
# First parameter is DISTRO if provided
[ $# -ge 2 ] && DISTRO="$1"
if [ "$DISTRO" = "" ] && [ -r /etc/os-release ];then
source /etc/os-release
case $ID in
sle*|*suse*)
DISTRO="SUSE"
;;
fedora*|centos*)
DISTRO="FEDORA"
;;
ubuntu*|debian*)
DISTRO="UBUNTU"
;;
esac
fi
if [ "$DISTRO" = "SUSE" ];then
export APACHE_USER="wwwrun"
export APACHE_GROUP="www"
elif [ "$DISTRO" = "UBUNTU" ];then
export APACHE_USER="www-data"
export APACHE_GROUP="www-data"
export WEBROOT="/var/www";
export WEBCONFIG="/etc/apache2/conf-available";
export DEFAULTPATH="etc/default"
elif [ "$DISTRO" = "FEDORA" ];then
export APACHE_USER="apache"
export APACHE_GROUP="apache"
export HTTPD_SERVICE="httpd.service"
export WEBROOT="/var/www";
export WEBCONFIG="/etc/httpd/conf.d";
export WEBROOTCONFIG="/etc/httpd";
export TFTPROOT="/var/lib/tftpboot"
else
echo "ERROR, unknown distro $DISTRO"
# ToDo: Should we loudly warn here?
fi