Skip to content

Commit b4ce2fe

Browse files
committed
Support shells that do not support stderr
1 parent ff5ccd9 commit b4ce2fe

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

pass-gen

+8-5
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,6 @@ if [[ "$1" ]]; then
344344
esac
345345
done
346346
fi
347-
generate_passphrase
348-
echo -n "$RANDOM_PASS" | xclip -selection "clipboard"
349-
>&2 echo "Generated passphrase copied to clipboard. Will clear in 45 seconds."
350-
clear_passphrase
351-
( sleep 45 ; echo -n "" | xclip -selection "clipboard" ) &
352347

353348
if [ "$DISPLAY_PASSWORD" = true ]; then
354349
for i in $(seq 1 $NUMBER_TO_DISPLAY); do
@@ -357,6 +352,14 @@ if [ "$DISPLAY_PASSWORD" = true ]; then
357352
echo $RANDOM_PASS
358353
echo -n "$RANDOM_PASS" | xclip -selection "clipboard"
359354
done
355+
clear_passphrase
356+
( sleep 45 ; echo -n "" | xclip -selection "clipboard" ) &
357+
else
358+
generate_passphrase
359+
echo -n "$RANDOM_PASS" | xclip -selection "clipboard"
360+
>&2 echo "Generated passphrase copied to clipboard. Will clear in 45 seconds."
361+
clear_passphrase
362+
( sleep 45 ; echo -n "" | xclip -selection "clipboard" ) &
360363
fi
361364

362365
if [[ "$REPORT_ENTROPY" = true ]]; then

0 commit comments

Comments
 (0)