Read in password instead of providing an argument
This commit is contained in:
parent
4359dfa302
commit
3e1fcedbb3
@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
: '
|
||||||
# give password as argument
|
# give password as argument
|
||||||
if [ $# -eq 1 ]; then
|
if [ $# -eq 1 ]; then
|
||||||
pass=$1
|
pass=$1
|
||||||
@ -11,14 +12,12 @@ else
|
|||||||
echo "Please only insert one argument"
|
echo "Please only insert one argument"
|
||||||
$(exit 1); echo "$?"
|
$(exit 1); echo "$?"
|
||||||
fi
|
fi
|
||||||
|
'
|
||||||
|
|
||||||
# TODO make this work
|
|
||||||
: '
|
|
||||||
# prompt for password
|
# prompt for password
|
||||||
echo -n Password:
|
echo -n "Password: "
|
||||||
read -s -r pass
|
read -s -r pass
|
||||||
echo
|
echo
|
||||||
'
|
|
||||||
|
|
||||||
# go to home dir
|
# go to home dir
|
||||||
cd "$HOME"
|
cd "$HOME"
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
: '
|
||||||
# give password as argument
|
# give password as argument
|
||||||
if [ $# -eq 1 ]; then
|
if [ $# -eq 1 ]; then
|
||||||
pass=$1
|
pass=$1
|
||||||
@ -11,6 +12,12 @@ else
|
|||||||
echo "Please only insert one argument"
|
echo "Please only insert one argument"
|
||||||
$(exit 1); echo "$?"
|
$(exit 1); echo "$?"
|
||||||
fi
|
fi
|
||||||
|
'
|
||||||
|
|
||||||
|
# prompt for password
|
||||||
|
echo -n "Password: "
|
||||||
|
read -s -r pass
|
||||||
|
echo
|
||||||
|
|
||||||
# go to home dir
|
# go to home dir
|
||||||
cd "$HOME"
|
cd "$HOME"
|
||||||
|
Loading…
Reference in New Issue
Block a user