Skip to content

Commit 9d263a9

Browse files
Maciej MazurWoody Gilk
authored andcommitted
Added pasword generation, fixes shadowhand#8
Signed-off-by: Woody Gilk <[email protected]>
1 parent df97b86 commit 9d263a9

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

gitcrypt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,18 @@ init_config() {
2828
done
2929

3030
while [ -z "$PASS" ]; do
31-
echo -n "Enter your passphrase: "
32-
read PASS
31+
echo -n "Generate a random password? [Y/n]"
32+
read answer
33+
34+
case "$answer" in
35+
n*|N*)
36+
echo -n "Enter your passphrase: "
37+
read PASS
38+
;;
39+
*)
40+
PASS=$(cat /dev/urandom | tr -dc '!@#$%^&*()_A-Z-a-z-0-9' | head -c32)
41+
;;
42+
esac
3343
done
3444

3545
while [ 1 ]; do

0 commit comments

Comments
 (0)