Skip to content

Commit 3fa7dbb

Browse files
Re-Order OptionString
* Alphabetical order * Fix missing k:
1 parent 0afe1ef commit 3fa7dbb

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

pve_backup_usb.sh

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ opt_backup_user='' # -u
4747
# parse options
4848
opt=''
4949
OPTIND='1'
50-
while getopts ':qb:cd:e:f:g:hjl:s:u:' opt
50+
while getopts ':b:cd:e:f:g:hjk:l:qs:u:' opt
5151
do
5252
case "${opt}" in
5353
# backup config
@@ -138,6 +138,11 @@ do
138138
fi
139139
;;
140140

141+
# quiet mode
142+
'q')
143+
opt_quiet='1'
144+
;;
145+
141146
# source dirs
142147
's')
143148
opt_source_paths_pvedumps_list="${OPTARG}"
@@ -160,11 +165,6 @@ do
160165
fi
161166
;;
162167

163-
# quiet mode
164-
'q')
165-
opt_quiet='1'
166-
;;
167-
168168
# show help
169169
'h')
170170
filename="$(basename "${0}")"
@@ -820,8 +820,7 @@ do
820820
break 1
821821
else
822822
message "${message} '${luks_target}'... not found, continuing."
823-
# nothing was found (yet)
824-
luks_target=""
823+
luks_target="" # nothing was found (yet)
825824
fi
826825

827826
# label of a partition
@@ -835,8 +834,7 @@ do
835834
break 1
836835
else
837836
message "${message} '${luks_target}'... not found, continuing."
838-
# nothing was found (yet)
839-
luks_target=""
837+
luks_target="" # nothing was found (yet)
840838
fi
841839

842840
# invalid value
@@ -854,8 +852,7 @@ then
854852
message "${message} '${luks_target}'... found."
855853
else
856854
message "${message} '${luks_target}'... not found, continuing."
857-
# nothing was found (yet)
858-
luks_target=""
855+
luks_target="" # nothing was found (yet)
859856
fi
860857
fi
861858
# use the first partition of the first usb storage device if no (useable) target was specified or found
@@ -867,6 +864,7 @@ then
867864
message "${message} '${luks_target}'... found."
868865
else
869866
message "${message} '${luks_target}'... not found."
867+
luks_target="" # nothing was found (yet)
870868
endScript "Could not determine any target partition for decryption (backup storage device available?)." "error"
871869
exit 1 # endScript should exit, this is just a fallback
872870
fi

0 commit comments

Comments
 (0)