-
Notifications
You must be signed in to change notification settings - Fork 24
/
setdomain.sh
52 lines (46 loc) · 1.25 KB
/
setdomain.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
#!/bin/bash
clear
echo "=== HADataC - The Human-Aware Data Acquisition Framework - Set Domain Script ==="
echo ""
# Make sure only root can run this script
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
# Make sure a domain name is provided
if [ $# -ne 1 ]; then
echo "This script requires the acronym of the new domain" 1>&2
exit 1
fi
echo "Requested domain: $1"
CONF_DIR="./conf"
HADATAC_CONF=$CONF_DIR/hadatac.conf
LABKEY=$CONF_DIR/labkey.config
NAMESPACES=$CONF_DIR/namespaces.properties
TEMPLATE=$CONF_DIR/templace.conf
AUTOCCSV=$CONF_DIR/autoccsv.config
echo ""
echo "testing " $HADATAC_CONF.$1
if [ -f $HADATAC_CONF.$1 ]; then
echo "Copying $HADATAC_CONF.$1 to $HADATAC_CONF"
cp -f $HADATAC_CONF.$1 $HADATAC_CONF
fi
if [ -f $LABKEY.$1 ]; then
echo "Copying $LABKEY.$1 to $LABKEY"
cp -f $LABKEY.$1 $LABKEY
fi
if [ -f $NAMESPACES.$1 ]; then
echo "Copying $NAMESPACES.$1 to $NAMESPACES"
cp -f $NAMESPACES.$1 $NAMESPACES
fi
if [ -f $TEMPLATE.$1 ]; then
echo "Copying $TEMPLATE.$1 to $TEMPLATE"
cp -f $TEMPLATE.$1 $TEMPLATE
fi
if [ -f $AUTOCCSV.$1 ]; then
echo "Copying $AUTOCCSV.$1 to $AUTOCCSV"
cp -f $AUTOCCSV.$1 $AUTOCCSV
fi
wait $!
echo "Domain has been set"
echo ""