3 echo 1>&2 Usage: $0 gforge.company.com
7 GFORGE_OPT=~/gforge/opt
8 GFORGE_DATA=~/gforge/data
9 GFORGE_CFG=~/gforge/etc
14 echo "$1" | egrep '^([[:alnum:]._-])*$' -q
16 if [ $found_host -ne 0 ]; then
17 echo 1>&2 "invalid hostname"
23 if [ ! -d $GFORGE_CFG ]; then
24 echo 1>&2 "$GFORGE_CFG didn't exist - error - make sure you've got permission"
29 if [ ! -d $GFORGE_OPT ]; then
30 echo 1>&2 "$GFORGE_OPT didn't exist - error - make sure you've got permission"
34 if [ ! -d $GFORGE_DATA ]; then
35 echo 1>&2 "$GFORGE_DATA didn't exist - error - make sure you've got permission"
46 mkdir localizationcache
48 #Create default location for SVN repositories
53 #Create default gforge config files
54 cp etc/local.inc.example $GFORGE_CFG/local.inc
55 cp etc/gforge-httpd.conf.example $GFORGE_CFG/httpd.conf
57 mkdir $GFORGE_CFG/plugins
59 #copy the scmcvs plugin config to /etc/gforge/
60 #if [ ! -d $GFORGE_CFG/plugins/scmcvs ]; then
61 # mkdir -p $GFORGE_CFG/plugins/scmcvs
63 #cp plugins/scmcvs/etc/plugins/scmcvs/config.php $GFORGE_CFG/plugins/scmcvs/config.php
65 #copy the scmsvn config files to /etc/gforge/
66 if [ ! -d $GFORGE_CFG/plugins/scmsvn ]; then
67 mkdir -p $GFORGE_CFG/plugins/scmsvn
69 cp plugins/scmsvn/etc/plugins/scmsvn/config.php $GFORGE_CFG/plugins/scmsvn/config.php
71 #copy the svntracker config files to /etc/gforge/
72 if [ ! -d $GFORGE_CFG/plugins/svntracker ]; then
73 mkdir $GFORGE_CFG/plugins/svntracker
75 cp plugins/svntracker/etc/plugins/svntracker/config.php $GFORGE_CFG/plugins/svntracker/config.php
81 if [ ! -d plugins/ ]; then
87 if [ ! -d scmsvn ]; then
88 ln -s ../../plugins/scmsvn/www/ scmsvn
90 if [ ! -d svntracker ]; then
91 ln -s ../../plugins/svntracker/www/ svntracker
94 # create symlink for fckeditor
95 if [ ! -d fckeditor ]; then
96 ln -s ../../plugins/fckeditor/www/ fckeditor
101 find $GFORGE_OPT -type d | xargs chmod 700
102 find $GFORGE_OPT -type f | xargs chmod 600
103 chmod 711 $GFORGE_OPT
104 find $GFORGE_OPT/www $GFORGE_OPT/plugins -type d | xargs chmod 711
105 find $GFORGE_OPT/www $GFORGE_OPT/plugins/*/www -type f | xargs chmod 744
106 find $GFORGE_OPT/www $GFORGE_OPT/plugins/*/www \( -name \*.php -o -name \*.class.php \) | xargs chmod 700
108 if [ ! -d $GFORGE_CFG ]; then
109 echo 1>&2 "$GFORGE_CFG didn't exist - error - make sure you've got permission"
112 find $GFORGE_CFG -type d | xargs chmod 700
113 find $GFORGE_CFG -type f | xargs chmod 600
114 find $GFORGE_CFG -type f -exec perl -pi -e "s/gforge\.company\.com/$1/" {} \;
115 find $GFORGE_CFG -type f -exec perl -pi -e "s/192\.168\.100\.100/$2/" {} \;
117 # echo "noreply: /dev/null" >> /etc/aliases