ADDED CL;ENUP TO PASSCHECK
This commit is contained in:
+16
-1
@@ -1,4 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -E p # FAIL ON ERROR USE TRAP
|
||||||
|
# error handling trap
|
||||||
|
trap 'echo "ERROR ON $LINENO! UNSETTING VARS FOR SECURITY"; unset $passphrase1; unset $passphrase2; unset $complexity_check; unset $sha1_digest; unset $first_five; unset $last_35; unset $curl_ret; echo "DONE"; exit 1' ERR
|
||||||
|
|
||||||
pass_min_length=40
|
pass_min_length=40
|
||||||
hibp_api="https://api.pwnedpasswords.com/range/"
|
hibp_api="https://api.pwnedpasswords.com/range/"
|
||||||
|
|
||||||
@@ -52,4 +56,15 @@ if grep -q -i "${last_35}" <<< "${curl_ret}"; then
|
|||||||
else
|
else
|
||||||
echo "PASS CHECKS OUT"
|
echo "PASS CHECKS OUT"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# cleanup
|
||||||
|
echo -e "\nUNSETTING VARS FOR SECURITY\n";
|
||||||
|
unset $passphrase1
|
||||||
|
unset $passphrase2
|
||||||
|
unset $complexity_check
|
||||||
|
unset $sha1_digest
|
||||||
|
unset $first_five
|
||||||
|
unset $last_35
|
||||||
|
unset $curl_ret;
|
||||||
|
echo -e "\nDONE\n"
|
||||||
Reference in New Issue
Block a user