13 while getopts l:p:cmrs opt; do
23 shift `expr $OPTIND - 1`
27 if [ "$2" -o \( "$source" -a $COPY = NO -a $MOVE = NO \) -o \( $COPY = YES -a $MOVE = YES \) ]; then
28 echo "Usage: $0 [-l label] [-p program] [-s] [-c|-m] [source]"
32 if [ "$source" ]; then
33 if [ -f "$source" ]; then
34 mkdir -p "$source_dir" || exit 1
35 elif [ -d "$source" ]; then
36 [ "$label" = "" ] && label="`basename \"$source\"`"
38 echo "$0 can only write files or directories"
41 if [ $COPY = YES ]; then
42 if [ -f "$source" ]; then
43 cp -p "$source" "$source_dir"
45 cpdir "$source" "$source_dir"
47 elif [ $MOVE = YES ]; then
48 mv "$source" "$source_dir"
52 if [ $setattrs = YES ]; then
53 setattrs.sh "$source_dir"
56 if [ -z "$label" ]; then
57 label="`guess_label.py`"
64 fi && ls-image && $prog && rm "$cd_image_iso" || exit 1
66 if [ $DELETE = YES ]; then
67 exec rm -r "$source_dir"