The libvirt_recover_xattrs.sh tool hangs when run. When no flags
are provided OPTIND is 1, so the loop expands to 'shift 0' which
has not effect. Rewrite to just loop over $@ instead which involves
less cleverness.
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
shift $((OPTIND - 1))
if [ $# -gt 0 ]; then
- while [ $# -gt 0 ]; do
- fix_xattrs "$1"
- shift $((OPTIND - 1))
+ for arg in "$@"
+ do
+ fix_xattrs "$arg"
done
else
if [ ${UNSAFE} -eq 1 ]; then