-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathphd_server_setup
executable file
·37 lines (31 loc) · 976 Bytes
/
phd_server_setup
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
#! /bin/bash
# default apache virtualhosts path
PHD_APACHE_VIRTUALHOSTS='/etc/apache2/phd-sites'
PHD_APACHE_CONFIG='/etc/apache2/apache2.conf'
PHD_APACHE_INCLUDE="Include $PHD_APACHE_VIRTUALHOSTS"
PUSHAND_INSTALL_DIR=~/tmp
# read .phdrc (for overrides)
if [[ -f ~/.phdrc ]]; then
source ~/.phdrc
fi
if [[ ! -w "$PHD_APACHE_CONFIG" ]]; then
echo "Don't have permission to edit $PHD_APACHE_CONFIG"
exit
fi
if [[ -z "$( which git-receive-pack_original )" ]]; then
echo "Installing PushAnd"
mkdir -p $PUSHAND_INSTALL_DIR
cd $PUSHAND_INSTALL_DIR
git clone git://github.com/remi/pushand.git
cd pushand
sudo ./pushand_server_install
fi
if [[ ! -f "$PHD_APACHE_VIRTUALHOSTS" ]]; then
echo "Creating virtualhosts directory"
mkdir -p $PHD_APACHE_VIRTUALHOSTS
chmod a+rw $PHD_APACHE_VIRTUALHOSTS
fi
if [[ -z "$( grep '$PHD_APACHE_INCLUDE' $PHD_APACHE_CONFIG )" ]]; then
echo "Including virtualhosts in configuration"
echo $PHD_APACHE_INCLUDE >> $PHD_APACHE_CONFIG
fi