--- a/verify-drbd.sh Thu Nov 20 15:25:28 2014 +0100
+++ b/verify-drbd.sh Tue Nov 22 14:09:19 2022 +0100
@@ -1,20 +1,25 @@
#!/bin/sh
-VERIFY_ALG='sha1'
-RESOURCES='all'
+DEFAULTS_FILE=/etc/default/verify-drbd
+[ -e $DEFAULTS_FILE ] && . $DEFAULTS_FILE
usage() {
cat <<__U
usage:
- $0 [-v verify-alg] [res ..[res]]
+ $0 [-o] [res ..[res]]
+ $0 -?
+
+ you may override disk and/or net options for verification in $DEFAULTS_FILE
+
__U
}
-while getopts "v:" opt; do
+while getopts "h" opt; do
case $opt in
- v)
- VERIFY_ALG="$OPTARG"
+ h)
+ usage
+ exit 0
;;
\?)
usage
@@ -29,9 +34,9 @@
fi
for r in $RESOURCES; do
- drbdadm -- --c-plan-ahead 1 --c-fill-target 64k disk-options $r
- drbdadm -- --verify-alg $VERIFY_ALG net-options $r
- drbdadm verify $r
+ [ -n "$DISK_OPTIONS" ] && drbdadm -- $DISK_OPTIONS disk-options $r
+ [ -n "$NET_OPTIONS" ] && drbdadm -- $NET_OPTIONS net-options $r
+ [ "$OPTIONS_ONLY" = 'y' ] || drbdadm verify $r
done
for r in $RESOURCES; do