- added a usage-screen and a system-type check

This commit is contained in:
frese 2004-09-20 15:59:15 +00:00
parent 0b1163c4c3
commit d403ceb52e
1 changed files with 16 additions and 5 deletions

View File

@ -321,9 +321,20 @@ Please choose a password with at least 2 character classes.")
(else
(lp pw))))))))
(define (display-usage)
(display "Usage: passwd-wrapper.scm\n")
(display "Change NIS, Kerberos IV and Kerberos V passwords at once.\n")
(display "Written by David Frese.\n"))
(define (main args)
(let ((old-pw (ask/check-old-password))
(new-pw (ask-new-password)))
(if (change-all-passwords old-pw new-pw)
(display "Password changed.\n")
(display "Password could not be changed.\n"))))
(if (null? (cdr args))
(case system-type
((freebsd solaris)
(let ((old-pw (ask/check-old-password))
(new-pw (ask-new-password)))
(if (change-all-passwords old-pw new-pw)
(display "Password changed.\n")
(display "Password could not be changed.\n"))))
(else
(raise-unsupported-machine)))
(display-usage)))