Added variable to every read call.

Needed for sh, not for bash.
This commit is contained in:
Benoît S. 2017-03-05 00:03:08 +01:00
parent c70498d6bc
commit 5c02c05dcc

View file

@ -11,7 +11,7 @@ if [ "`id -u`" != "0" ]; then
echo "Please become root before running shellpki!" echo "Please become root before running shellpki!"
echo echo
echo "Press return to continue..." echo "Press return to continue..."
read read REPLY
exit 1 exit 1
fi fi
@ -19,7 +19,7 @@ init() {
echo "Do you confirm shellpki initialization?" echo "Do you confirm shellpki initialization?"
echo echo
echo "Press return to continue..." echo "Press return to continue..."
read read REPLY
echo echo
if [ ! -d $PREFIX/ca ]; then mkdir -p $PREFIX/ca; fi if [ ! -d $PREFIX/ca ]; then mkdir -p $PREFIX/ca; fi
@ -46,14 +46,14 @@ create() {
echo echo
echo "Your CN is '$cn'" echo "Your CN is '$cn'"
echo "Press return to continue..." echo "Press return to continue..."
read read REPLY
echo echo
if [ -e $PREFIX/certs/$cn.crt ]; then if [ -e $PREFIX/certs/$cn.crt ]; then
echo "Please revoke actual $cn cert before creating one" echo "Please revoke actual $cn cert before creating one"
echo echo
echo "Press return to continue..." echo "Press return to continue..."
read read REPLY
exit 1 exit 1
fi fi
@ -62,7 +62,7 @@ create() {
# generate private key # generate private key
echo -n "Should private key be protected by a passphrase? [y/N] " echo -n "Should private key be protected by a passphrase? [y/N] "
read read REPLY
if [ "$REPLY" = "y" ] || [ "REPLY" = "Y" ]; then if [ "$REPLY" = "y" ] || [ "REPLY" = "Y" ]; then
$OPENSSL genrsa -des3 -out $DIR/$cn.key 2048 $OPENSSL genrsa -des3 -out $DIR/$cn.key 2048
else else
@ -131,7 +131,7 @@ revoke() {
echo echo
echo "CN '$cn' will be revoked" echo "CN '$cn' will be revoked"
echo "Press return to continue..." echo "Press return to continue..."
read read REPLY
echo echo
$OPENSSL ca \ $OPENSSL ca \
@ -153,7 +153,7 @@ fromcsr() {
echo "Error in path..." echo "Error in path..."
echo echo
echo "Press return to continue..." echo "Press return to continue..."
read read REPLY
exit 1 exit 1
fi fi
@ -162,7 +162,7 @@ fromcsr() {
echo echo
echo "Your CN is '$cn'" echo "Your CN is '$cn'"
echo "Press return to continue..." echo "Press return to continue..."
read read REPLY
echo echo
DIR=$PREFIX/files/req_$cn-$TIMESTAMP DIR=$PREFIX/files/req_$cn-$TIMESTAMP