]>
Commit | Line | Data |
---|---|---|
dc118460 ZU |
1 | #!/bin/bash |
2 | ||
3 | function help() { | |
4 | cat << EOF | |
5 | Usage: $0 html_path app_path | |
6 | html_path: directory, where your CodeIgniter's index.php is (e.g. ~/public_html/ci) | |
7 | app_path: directory, where your CodeIgniter programs are (e.g. ~/programs/CI) | |
8 | EOF | |
9 | } | |
10 | ||
11 | if [ $# -ne 2 ]; then | |
12 | help | |
13 | exit 1 | |
14 | fi | |
15 | ||
16 | WEBDIR=$1 | |
17 | APPDIR=$2 | |
18 | CI_DIR=/usr/share/CodeIgniter | |
19 | ||
20 | echo "Create web-directory ($WEBDIR)" | |
21 | install -d $WEBDIR || exit 1 | |
22 | echo "Copy install.php to $WEBDIR" | |
23 | install $CI_DIR/index.php $WEBDIR || exit 1 | |
24 | sed -i "s@\$application_folder.*=.*@\$application_folder = \"$APPDIR\";@" $WEBDIR/index.php || exit 1 | |
25 | ||
26 | echo "Create main app directory ($APPDIR)" | |
27 | install -d $APPDIR || exit 1 | |
28 | echo "Creating directories to app directory" | |
1305dba9 | 29 | for dir in cache config controllers core errors helpers hooks language libraries logs models third_party; do |
dc118460 | 30 | install -d $APPDIR/$dir || exit 1 |
1305dba9 | 31 | [ -d $CI_DIR/application/$dir ] && (cp -r -n $CI_DIR/application/$dir/* $APPDIR/$dir || exit 1) |
dc118460 ZU |
32 | done |
33 | ||
34 | echo Installation done. | |
35 |