Revision cfd38847
b/snf-image-host/snf-image-update-helper.in | ||
---|---|---|
5 | 5 |
|
6 | 6 |
. @osdir@/common.sh |
7 | 7 |
|
8 |
list_defaults() { |
|
9 |
cat <<EOF |
|
10 |
|
|
11 |
*** DEFAULT HELPER VALUES *** |
|
12 |
|
|
13 |
Helper directory: $HELPER_DIR |
|
14 |
Helper cache file: $HELPER_CACHE_FILE |
|
15 |
Helper snf-image-helper pkg: $HELPER_PKG |
|
16 |
|
|
17 |
EOF |
|
18 |
} |
|
19 |
|
|
20 | 8 |
usage() { |
21 | 9 |
local rc="$1" |
22 | 10 |
|
... | ... | |
29 | 17 |
ganeti's \`snf-image' guest OS type. |
30 | 18 |
|
31 | 19 |
OPTIONS: |
32 |
-c Overwrite the default cache file |
|
33 |
-d Overwrite the default directory where the helper image will be hosted |
|
34 |
-h Show this message |
|
35 |
-l List default helper values |
|
36 |
-p Overwrite the default snf-image-helper debian package |
|
37 |
-y Automatic yes to prompts and run non-interactively. |
|
20 |
-c CACHE_FILE |
|
21 |
Use this cache file, instead of the default |
|
22 |
[default: $HELPER_CACHE_FILE] |
|
23 |
|
|
24 |
-d DIRECTORY |
|
25 |
Use this directory to host the created files, instead of the default |
|
26 |
[default: $HELPER_DIR] |
|
27 |
|
|
28 |
-h Print this message |
|
29 |
|
|
30 |
-p PACKAGE |
|
31 |
Install this deb package in the helper image, instead of the default |
|
32 |
[default: $HELPER_PKG] |
|
33 |
|
|
34 |
-y Assume Yes to all queries and do not prompt |
|
38 | 35 |
|
39 | 36 |
EOF |
40 | 37 |
|
41 | 38 |
exit "$rc" |
42 | 39 |
} |
43 | 40 |
|
44 |
while getopts "c:d:hlp:y" opt; do
|
|
41 |
while getopts "c:d:hp:y" opt; do |
|
45 | 42 |
case $opt in |
46 | 43 |
c) HELPER_CACHE_FILE="$OPTARG" |
47 | 44 |
;; |
... | ... | |
66 | 63 |
echo |
67 | 64 |
|
68 | 65 |
if [ ! -d "$HELPER_DIR" -o ! -w "$HELPER_DIR" ]; then |
66 |
log_error "ERROR:" |
|
69 | 67 |
log_error "Helper directory \`$HELPER_DIR' does not exist or the script" \ |
70 | 68 |
"has no write permission on it." |
71 | 69 |
exit 1 |
72 | 70 |
fi |
73 | 71 |
|
74 | 72 |
if [ ! -r "$HELPER_PKG" ]; then |
73 |
log_error "ERROR:" |
|
75 | 74 |
log_error "Helper package \`$HELPER_PKG' does not exist or is not " \ |
76 | 75 |
"readable by the script." |
77 | 76 |
exit 1 |
Also available in: Unified diff