2 . ${CIRROS_LIB:=/lib/cirros/shlib_cirros} ||
3 { echo "failed to read ${CIRROS_LIB}" 1>&2; exit 1; }
7 ${0##*/} device [log] [summary]
8 resize the device with log sent to 'log'.
10 if log is provided, stderr and stdout are redirected to that file
11 if summary is provided, a summary (success/fail) will be written there
19 [ $# -eq 1 -o $# -eq 2 -o $# -eq 3 ] ||
20 { Usage 1>&2; exit 1; }
21 [ "$1" = "-h" -o "$1" = "--help" ] && { Usage; exit 0; }
23 if [ -n "$log" -o "$log" = "-" ]; then
24 time_call resize2fs "$dev" >"$log" 2>&1
26 time_call resize2fs "$dev"
31 summary="$dev resized successfully [took ${delta}s]" ||
32 summary="$dev resize failed ($ret) [took ${delta}s]"
34 if [ "$log" = "-" ]; then
36 elif [ -n "$log" ]; then
37 echo "$summary" >> "$log"
39 if [ -n "$sumfile" ]; then
40 [ "$sumfile" = "-" ] && echo "$summary" || echo "$summary" >> "$sumfile"
45 # vi: ts=4 noexpandtab