View | Details | Raw Unified | Return to bug 6540
Collapse All | Expand All

(-)a/debian/scripts/koha-create (-14 / +23 lines)
Lines 19-31 Link Here
19
19
20
set -e
20
set -e
21
21
22
23
die() {
22
die() {
24
    echo "$@" 1>&2
23
    echo "$@" 1>&2
25
    exit 1
24
    exit 1
26
}
25
}
27
26
28
29
generate_config_file() {
27
generate_config_file() {
30
    touch "$2"
28
    touch "$2"
31
    chown "root:$username" "$2"
29
    chown "root:$username" "$2"
Lines 60-66 getinstancemysqlpassword() { Link Here
60
        "/etc/koha/sites/$1/koha-conf.xml"
58
        "/etc/koha/sites/$1/koha-conf.xml"
61
}
59
}
62
60
63
64
# Set defaults and read config file, if it exists.
61
# Set defaults and read config file, if it exists.
65
DOMAIN=""
62
DOMAIN=""
66
INTRAPORT="8080"
63
INTRAPORT="8080"
Lines 74-91 then Link Here
74
    . /etc/koha/koha-sites.conf
71
    . /etc/koha/koha-sites.conf
75
fi
72
fi
76
73
74
[ $# -ge 2 ] && [ $# -le 6 ] || 
75
    die "Usage: $0 [--create-db|--request-db|--populate-db] \
76
[--marcflavor marc21|normarc|unimarc] \
77
[--zebralang en|fr|nb] instancename"
78
79
TEMP=`getopt -o crpm:l: -l create-db,request-db,populate-db,marcflavor:,zebralang: \
80
     -n "$0" -- "$@"`
81
82
# Note the quotes around `$TEMP': they are essential!
83
eval set -- "$TEMP"
84
85
while true ; do
86
	case "$1" in
87
		-c|--create-db) op=create ; shift ;;
88
		-r|--request-db) op=request ; shift ;;
89
		-p|--populate-db) op=populate ; shift ;;
90
		-m|--marcflavor) ZEBRA_MARC_FORMAT="$2" ; shift 2 ;;
91
		-l|--zebralang) ZEBRA_LANGUAGE="$2" ; shift 2 ;;
92
		--) shift ; break ;;
93
		*) die "Internal error! " ;;
94
	esac
95
done
77
96
78
# Parse command line.
97
name="$1"
79
[ "$#" = 2 ] || 
80
    die "Usage: $0 [--create-db|--request-db|--populate-db] instancename"
81
case "$1" in
82
  --create-db) op=create ;;
83
  --request-db) op=request ;;
84
  --populate-db) op=populate ;;
85
  *) die "Usage: $0 [--create-db|--request-db|--populate-db] instancename" ;;
86
esac
87
98
88
name="$2"
89
domain="$name$DOMAIN"
99
domain="$name$DOMAIN"
90
if [ "$INTRAPORT" = 80 ] || [ "$INTRAPORT" = "" ]
100
if [ "$INTRAPORT" = 80 ] || [ "$INTRAPORT" = "" ]
91
then
101
then
92
- 

Return to bug 6540