Skip to content
Snippets Groups Projects
Verified Commit 045924ba authored by Karel Koci's avatar Karel Koci :metal:
Browse files

diagnostics.sh: fix background mode not getting any arguments

The shift of all option argument caused backgrounded instance to run as
if there no arguments were passed.
parent 854ca8e3
Branches
Tags
1 merge request!18diagnostics.sh: fix background mode not getting any arguments
......@@ -129,20 +129,20 @@ while getopts "hlbBo:O:" opt; do
;;
esac
done
shift "$((OPTIND - 1))"
if [ "$list_modules" = "y" ]; then
list_modules
if [ "$background" = "y" -a "$TURRIS_DIAGNOSTICS_IN_BACKGROUND" != "1" ]; then
TURRIS_DIAGNOSTICS_IN_BACKGROUND=1 "$0" "$@" >/dev/null 2>&1 </dev/null &
exit 0
fi
shift "$((OPTIND - 1))"
if [ "$background" = "y" -a "$TURRIS_DIAGNOSTICS_IN_BACKGROUND" != "1" ]; then
export TURRIS_DIAGNOSTICS_IN_BACKGROUND=1
"$0" "$@" >/dev/null 2>&1 </dev/null &
if [ "$list_modules" = "y" ]; then
list_modules
exit 0
fi
# Clean the last output files
if [ -n "$OUTPUT_FILE" ]; then
rm -rf "$OUTPUT_FILE"
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment