#! /bin/sh #---------------------------------------------------------------------------- # /var/install/bin/change-password - change password of a user # # Copyright (c) 2001-2005 The Eisfair Team, c/o Frank Meyer, frank(at)eisfair(dot)org # # Creation: 04.11.2001 fm # Last Update: $Id$ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------- # include eislib . /var/install/include/eislib clrhome mecho -info "Change password" echo echo /var/install/bin/ask "User:" '' '*' > /tmp/ask.$$ rc=$? user=`cat /tmp/ask.$$` rm -f /tmp/ask.$$ if [ $rc = 255 ] then exit 1 fi if [ "$user" != "" ] then echo grep "^$user:" /etc/passwd >/dev/null if [ $? = 0 ] then #echo "Changing password of user $user:" passwd $user else echo mecho -warn "User $user does not exist!" anykey exit 1 fi else echo mecho -warn "Command aborted" anykey exit 1 fi echo anykey