Browse Source

create_instance script enhancement to fit with runtest bugfix

Yann Weber 8 years ago
parent
commit
6e36af8094
1 changed files with 16 additions and 7 deletions
  1. 16
    7
      progs/create_instance.sh

+ 16
- 7
progs/create_instance.sh View File

1
 #!/bin/bash
1
 #!/bin/bash
2
 
2
 
3
 usage() {
3
 usage() {
4
-	echo -e "Usage : $0 instance_name (instance_dir|-u) [install_tpl] [em_file]" 1>&2
5
-	echo -e "\n\tIf -u given as first argument update instance's loader.py" 1>&2
4
+	echo -e "Usage : $0 instance_name (instance_dir|-u) [install_tpl] [em_file] [lidir]" >&2
5
+	echo -e "\n\tIf -u given as first argument update instance's loader.py" >&2
6
 	exit 1
6
 	exit 1
7
 }
7
 }
8
 
8
 
15
 
15
 
16
 if [ $# -lt 2 ]
16
 if [ $# -lt 2 ]
17
 then
17
 then
18
-	echo "Not enough arguments" 1>&2
18
+	echo "Not enough arguments" >&2
19
 	usage
19
 	usage
20
 fi
20
 fi
21
 
21
 
24
 name="$1"
24
 name="$1"
25
 instdir="$2"
25
 instdir="$2"
26
 
26
 
27
-
28
-libdir=[@]PKGPYTHONDIR[@]
27
+libdir="$5"
28
+libdir=${libdir:=[@]PKGPYTHONDIR[@]}
29
 install_tpl="$3"
29
 install_tpl="$3"
30
-[ -z "$install_tpl" ] && usage
30
+if [ -z "$install_tpl" ]
31
+then
32
+	echo -e "Install template $install_tpl not found.\n" >&2
33
+	usage
34
+fi
35
+
31
 em_file="$4"
36
 em_file="$4"
32
-[ -z "$em_file" ] && usage
37
+if [ -z "$em_file" ]
38
+then
39
+	echo -e "Emfile $emfile not found.\n" >&2
40
+	usage
41
+fi
33
 
42
 
34
 
43
 
35
 libdir=$(realpath $libdir)
44
 libdir=$(realpath $libdir)

Loading…
Cancel
Save