summaryrefslogtreecommitdiffstats
path: root/satellit_installer/includes/10-configurations.inc
diff options
context:
space:
mode:
authorroot2014-06-30 15:21:04 +0200
committerroot2014-06-30 15:21:04 +0200
commit9aabe45d6e2865dcc95e4a6f5823c9310904b1e9 (patch)
tree2b53f43e95d3944b73864f4e5995a75ab42a61b0 /satellit_installer/includes/10-configurations.inc
downloadsetup-scripts-9aabe45d6e2865dcc95e4a6f5823c9310904b1e9.tar.gz
setup-scripts-9aabe45d6e2865dcc95e4a6f5823c9310904b1e9.tar.xz
setup-scripts-9aabe45d6e2865dcc95e4a6f5823c9310904b1e9.zip
[SSPS] Satellite server preparation script. Further heavy debugging needed -
this is just the first checkin after tidying to server as a starting point.
Diffstat (limited to 'satellit_installer/includes/10-configurations.inc')
-rw-r--r--satellit_installer/includes/10-configurations.inc68
1 files changed, 68 insertions, 0 deletions
diff --git a/satellit_installer/includes/10-configurations.inc b/satellit_installer/includes/10-configurations.inc
new file mode 100644
index 0000000..f68ac5a
--- /dev/null
+++ b/satellit_installer/includes/10-configurations.inc
@@ -0,0 +1,68 @@
+unpack_tar_gz() {
+ echo
+ echo -n "# Unpacking given tar file $1, using extra options $2 ..."
+ tar xzf "$1" $2
+ ERR=$?
+ if [ "$ERR" -ne 0 ]; then
+ echo
+ echo "# Could not unpack tar file $1!"
+ # Fehlerbehandlung?
+ else
+ echo "ok."
+ fi
+}
+
+patch_pureftpd_config() {
+ # $1: user, $2: database, $3: Password
+ echo -n "# Patching pureftpd configuration..."
+ cp -p /etc/pure-ftpd/db/mysql.conf /etc/pure-ftpd/db/mysql.conf.$(date +%Y%m%d%H%M%S)
+ sed -i "s/MYSQLUser.*$/MYSQLUser $1/g" /etc/pure-ftpd/db/mysql.conf
+ sed -i "s/MYSQLPassword.*$/MYSQLPassword $3/g" /etc/pure-ftpd/db/mysql.conf
+ sed -i "s/MYSQLDatabase.*$/MYSQLDatabase $2/g" /etc/pure-ftpd/db/mysql.conf
+ echo "ok."
+}
+
+patch_atftpd_config() {
+ echo -n "# Stopping atftpd server in case it's not managed by inetd..."
+ /etc/init.d/atftpd stop 2>/dev/null 1>&2
+ echo "ok."
+ # No sense in patching, we will drop this little entry.
+ echo -n "# Patching atftpd configuration..."
+ echo "USE_INETD=false" > /etc/default/atftpd
+ echo 'OPTIONS="--retry-timeout 1 --maxthread 100 --verbose=5 --no-multicast --bind-address 0.0.0.0 /srv/openslx/tftp"' >> /etc/default/atftpd
+ echo "ok."
+ echo -n "# Starting atftpd server..."
+ /etc/init.d/atftpd start 2>/dev/null 1>&2
+ echo "ok."
+}
+
+patch_lighttpd_config() {
+ echo -n "# Stopping lighttpd server..."
+ /etc/init.d/lighttpd stop 2>/dev/null 1>&2
+ echo "ok."
+ echo -n "# Patching lighttpd configuration..."
+ cp -p /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.$(date +%Y%m%d%H%M%S)
+ cp -p "$BASEDIR/static_files/lighttpd.conf" /etc/lighttpd/lighttpd.conf
+ echo "ok."
+ cd /etc/lighttpd/conf-enabled
+ [ ! -h 10-fastcgi.conf ] && ln -s ../conf-available/10-fastcgi.conf
+ [ ! -h 15-fastcgi-php.conf ] && ln -s ../conf-available/15-fastcgi-php.conf
+ echo -n "# Starting lighttpd server..."
+ mkdir -p "$1" 2>/dev/null
+ /etc/init.d/lighttpd start 2>/dev/null 1>&2
+ cd -
+ echo "ok."
+}
+
+config_nfs() {
+ echo -n "# Patching /etc/exports for NFS... "
+ if [ $(grep -c "/srv/openslx/nfs" /etc/exports) -gt 0 ]; then
+ echo -n "NFS entry already there; doing nothing."
+ else
+ echo '/srv/openslx/nfs *(ro,async,insecure,no_root_squash,no_subtree_check)' >> /etc/exports
+ echo "ok."
+ fi
+ mkdir -p /srv/openslx/nfs 2>/dev/null
+ chown bwlehrpool:images /srv/openslx/nfs
+ chmod 775 /srv/openslx/nfs
+}