Write frontend and backend for pwquality

master
Артемий 3 years ago
parent 417f6d39c3
commit c2d0bb089f

@ -75,6 +75,7 @@ _mk_pwquality_conf() {
--maxclassrepeat) shift; --maxclassrepeat) shift;
_check_argument_is_number "$1" "--maxclassrepeat" || failed=1 _check_argument_is_number "$1" "--maxclassrepeat" || failed=1
maxclassrepeat="$1" maxclassrepeat="$1"
shift
;; ;;
--gecoscheck) shift; --gecoscheck) shift;
_check_argument_is_number "$1" "--gecoscheck" || failed=1 _check_argument_is_number "$1" "--gecoscheck" || failed=1
@ -85,7 +86,7 @@ _mk_pwquality_conf() {
--dictcheck) shift; --dictcheck) shift;
_check_argument_is_number "$1" "--dictcheck" || failed=1 _check_argument_is_number "$1" "--dictcheck" || failed=1
[[ "$1" =~ (0|1) ]] || { error $"The received parameters are not correct. Expected %s, received %s" $"0 or 1" "$1"; failed=1; } [[ "$1" =~ (0|1) ]] || { error $"The received parameters are not correct. Expected %s, received %s" $"0 or 1" "$1"; failed=1; }
dickcheck="$1" dictcheck="$1"
shift shift
;; ;;
--usercheck) shift; --usercheck) shift;

@ -32,7 +32,7 @@ _check_argument_is_number() {
# $1 - value # $1 - value
# $2 - param name # $2 - param name
_check_argument_value() { _check_argument_value() {
if [[ "$1" < "$2" ]]; then if (( "$1" < "$2" )); then
error $"Argument to %s must be greater than %s" "$2" "$3" error $"Argument to %s must be greater than %s" "$2" "$3"
return 1 return 1
else else

Loading…
Cancel
Save