3 # Simple wrapper for FusionForge installation
5 # Usage: ./install-ng <hostname>
7 # This will install all the fusionforge code in $FORGE_HOME
8 # Configuration is stored in /etc/gforge
10 # Currently supported:
11 # * Red Hat 5 / CentOS 5
12 # * OpenSuSE 11 (contributed by Martin Bernreuther)
14 # Author: Alain Peyrat <aljeux@free.fr>
15 # Christian Bayle <bayle@debian.org>
17 FORGE_HOME=/opt/gforge
20 echo "Usage: $1 [-r|-h|-a|--reinit|--help|--auto|--deps|--files|--database|--config] [<hostname>]"
23 options=`getopt -o rha -l reinit,help,auto,deps,files,database,config -- "$@"`
25 if [ $? != 0 ] ; then echo "Terminating..." >&2 ; usage $0 ;exit 1 ; fi
27 eval set -- "$options"
32 # Install dependancies files database config by default
35 # Install dependancies
47 -r|--reinit) REINIT=true; shift 1;;
48 -h|--help) usage $0 ; exit 0; shift 1;;
49 -a|--auto) AUTO=true ; shift 1;;
50 --deps) DEFAULT=false ; DEPS=true ; shift 1;;
51 --files) DEFAULT=false ; FILES=true ; shift 1;;
52 --database) DEFAULT=false ; DATABASE=true ; shift 1;;
53 --config) DEFAULT=false ; CONFIG=true ; shift 1;;
63 hostname=`hostname -f`
65 echo "Using hostname=$hostname"
68 scriptdir=`cd \`dirname $0\`; pwd`
69 . $scriptdir/install/detect_os
71 FUSIONFORGE_DEFAULT_SRC_DIR=$(cd $(dirname $0); pwd)
72 FUSIONFORGE_DEFAULT_DIR=$FUSIONFORGE_DEFAULT_SRC_DIR
73 fusionforge_src_dir=${FUSIONFORGE_SRC_DIR:-$FUSIONFORGE_DEFAULT_SRC_DIR}
74 fusionforge_dir=${FUSIONFORGE_DIR:-$FUSIONFORGE_DEFAULT_DIR}
75 fusionforge_data_dir=${FUSIONFORGE_DATA_DIR:-/var/lib/gforge}
76 fusionforge_log_dir=${FUSIONFORGE_LOG_DIR:-/var/log/gforge}
77 fusionforge_etc_dir=${FUSIONFORGE_ETC_DIR:-/etc/gforge}
79 # Call to detect_os, this will set $type and $distrib
85 # Load deps script and run the appropriate one
86 . $scriptdir/install/deps
90 # Load install scripts
91 . $scriptdir/install/install2
92 . $scriptdir/install/install3
93 . $scriptdir/install/install4
94 . $scriptdir/install/install5_post
95 . $scriptdir/install/install6_upgrade
99 echo "Using automatic configuration"
102 FFORGE_ADMIN_USER=admin
103 FFORGE_ADMIN_PASSWORD=myadmin
108 echo "Reinit the database"
109 rm -f /etc/gforge/install_completed
110 dropdbifexists $FFORGE_DB
113 if [ -d "$FORGE_HOME" ]
115 if [ -f "/etc/gforge/install_completed" ]
118 echo "Upgrading previous installation ...";
121 echo "Installing FusionForge ...";
125 echo "Installing FusionForge ...";
128 echo "Install type = $type"
129 if $DEFAULT || $FILES
131 install2_files_$type "$hostname"
134 if [ "$mode" = "install" ]
136 if $DEFAULT || $DATABASE
138 echo "Running install3_db_$type"
141 if $DEFAULT || $CONFIG
143 echo "Running install4_config_$type"
144 install4_config_$type
148 echo "Running install5_post_$type"
149 install5_post_$type "$hostname"
154 echo "Running install6_upgrade_$type"
155 install6_upgrade_$type
159 echo "check /etc/gforge/local.inc for $hostname specific FusionForge settings"
160 echo "Write INSTALL COMPLETED"
161 date >> /etc/gforge/install_completed
162 ls -al /etc/gforge/install_completed