diff options
Diffstat (limited to 'pinyadmin')
-rwxr-xr-x | pinyadmin/bin/newpasshash | 2 | ||||
-rw-r--r-- | pinyadmin/sbin/newpasshash | 15 |
2 files changed, 17 insertions, 0 deletions
diff --git a/pinyadmin/bin/newpasshash b/pinyadmin/bin/newpasshash new file mode 100755 index 0000000..e5cf7b1 --- /dev/null +++ b/pinyadmin/bin/newpasshash @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/sudo /usr/sbin/newpasshash "$@" diff --git a/pinyadmin/sbin/newpasshash b/pinyadmin/sbin/newpasshash new file mode 100644 index 0000000..bf55a76 --- /dev/null +++ b/pinyadmin/sbin/newpasshash @@ -0,0 +1,15 @@ +#!/usr/bin/perl + +my ( $crypt ) = @ARGV; + +if ( $crypt eq "" ) { + print "You must enter a password!\n"; + exit 1; +}; + +my $ret = system( "/usr/sbin/usermod", "-P", $crypt, $ENV{'SUDO_USER'}); + +if ( $ret ) { + print "An error occured.\n"; + exit 2; +}; |