Revision 177,
1.6 KB
checked in by mmamonski, 12 years ago
(diff) |
Resubmit from checkpoint only for finished jobs, improved installation scripts, increased default proxy lifetime, MouseEvent? logging, Fixed typo in documentation
|
-
Property svn:executable set to
*
|
Line | |
---|
1 | #!/bin/bash |
---|
2 | |
---|
3 | fail() { |
---|
4 | echo -e '\033[01;41m'"$@"'\033[00m' |
---|
5 | exit 1 |
---|
6 | } |
---|
7 | |
---|
8 | TARGET='QCG-Icon-LinuxInstaller.sh' |
---|
9 | |
---|
10 | echo "ant clean" |
---|
11 | ant clean > /dev/null || fail "clean failed" |
---|
12 | echo "ant jar" |
---|
13 | ant jar > /dev/null || fail "jar failed" |
---|
14 | echo "Building script" |
---|
15 | |
---|
16 | cat << eof > "$TARGET" |
---|
17 | #!/bin/bash |
---|
18 | echo "Welcome to QCG-Icon 'installer'" |
---|
19 | echo -n " please specify target dir (or press return for default [qcg-icon]): " |
---|
20 | read tgt |
---|
21 | tgt="\${tgt:-qcg-icon}" |
---|
22 | tgt=\`eval echo \${tgt}\` |
---|
23 | echo "Installing QCG-Icon into \$tgt" |
---|
24 | if [[ ! -d "\${tgt}" ]] |
---|
25 | then |
---|
26 | if mkdir -p "\${tgt}" ; then :; else echo "Cannot create target dir"; exit 1 ; fi |
---|
27 | else |
---|
28 | ans= |
---|
29 | until [[ "\$ans" = y || "\$ans" = n || "\$ans" = Y || "\$ans" = N ]] |
---|
30 | do |
---|
31 | ans= |
---|
32 | echo -n " dir exists, continue? [y/N]: " |
---|
33 | read ans |
---|
34 | ans="\${ans:-n}" |
---|
35 | done |
---|
36 | if [[ "\$ans" = n || "\$ans" = N ]] |
---|
37 | then |
---|
38 | echo "Cancelling instalation" |
---|
39 | exit 1 |
---|
40 | fi |
---|
41 | fi |
---|
42 | |
---|
43 | ARCHIVE=\`awk '/^__ARCHIVE__/ {print NR + 1; exit 0; }' "\$0"\` |
---|
44 | tail -n+"\$ARCHIVE" "\$0" | tar xj -C "\${tgt}" |
---|
45 | |
---|
46 | if (( "\$?" == 0 )) |
---|
47 | then |
---|
48 | chmod a+x "\${tgt}/qcg-icon" |
---|
49 | echo "Installation finished." |
---|
50 | else |
---|
51 | echo "Installation failed!" |
---|
52 | exit 1 |
---|
53 | fi |
---|
54 | |
---|
55 | ans= |
---|
56 | until [[ "\$ans" = y || "\$ans" = n || "\$ans" = Y || "\$ans" = N ]] |
---|
57 | do |
---|
58 | ans= |
---|
59 | echo -n " Run qcg-icon? [Y/n]: " |
---|
60 | read ans |
---|
61 | ans="\${ans:-y}" |
---|
62 | done |
---|
63 | if [[ "\$ans" = y || "\$ans" = Y ]] |
---|
64 | then |
---|
65 | ( cd "\${tgt}" && ./qcg-icon & disown ) |
---|
66 | exit 1 |
---|
67 | fi |
---|
68 | |
---|
69 | exit 0 |
---|
70 | |
---|
71 | __ARCHIVE__ |
---|
72 | eof |
---|
73 | |
---|
74 | echo "adding tar payload" |
---|
75 | tar cj --exclude-vcs -C dist lib QCG-Icon.jar -C ../dist_static logging.properties urls.properties certs resources -C ../dist_linux config.properties qcg-icon >> ${TARGET} || fail "packing failed" |
---|
76 | |
---|
77 | chmod +x ${TARGET} |
---|
78 | echo "finished!" |
---|
79 | |
---|
80 | |
---|
Note: See
TracBrowser
for help on using the repository browser.