summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-system/switch_web.sh
blob: bf57764fc10cf2a6303fc42d075ecb1d303749f5 (plain)
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
#!/bin/bash
#This script is used to switch the default homepage between supplementalweb and
#the standard local webpage
. /etc/systemconfig
DATADIR=/data/srv/httpd/htdocs

function rmindex {
    if [ -L $DATADIR/index.html ]
    then
        rm -f $DATADIR/index.html
    fi
}

if [ $SystemType = Master_backend -o  $SystemType = Standalone ]
then
    if [ x$1 = xsupplemental ]
    then
        rmindex
        ln -s $DATADIR/alt_index.html $DATADIR/index.html
   else
       rmindex
       ln -s $DATADIR/index.htm $DATADIR/index.html
   fi
else
	echo "This service is only available for StandAlone or Master_backend LinHES systems"

fi