Hehe, that's too easy
I did programm something myself to add users
<?php
[...]
exec ('htpasswd and more code to add user');
[...]
?>
now I need to delete one single user from the .htpasswd file
the command to do this is "htpasswd -D .htpasswd username" but my htpasswd command does not support the -D option
I'd like to do something like this
so I can call the script withCode:#!/bin/bash users=`cat /path/to/.htpasswd` $searchFor =`cat /path/to/.htpasswd | grep $1` for Name in $users do #if $name is not the username to be deleted write to a tmp file if [$Name != $searchFor] write $name to /path/to/htpasswd.tmp fi done mv /path/to/htpasswd.tmp /path/to/.htpasswd done
$ ./script.sh username
Develish ;D




Reply With Quote
Bookmarks