[ UP ] cgi
[archserver.git] / cgi / samba / update_user.cgi
blob9a49959105db7456e030871e0bbc402cac611bb8
1 #!/bin/sh
2 echo -e "Content-type: text/html\n\n";
3 source ./proccgi.sh
5 echo "User: $F_user_name<br>"
6 echo "Pass: $F_passwd<br>"
8 [ "$F_user_name" = "" ] && echo "<h1>Please enter username</h1>" && exit
9 [ "$F_passwd" = "" ] && echo "<h1>Please enter password</h1>" && exit
11 if sudo cat /etc/samba/private/passwd | cut -f1 -d: | egrep "\<$F_user_name\>"; then
12 (echo $F_passwd; echo $F_passwd) |sudo passwd -s -a $F_user_name
13 echo "Changed password to: \"$F_passwd\""
14 exit
17 echo "User $F_user_name not exist, Please create it."