January 02, 2013

PureFTPD User add/del scripts

ftpadduser:
#!/bin/bash
echo Adding FTP user $1
pure-pw useradd $1 -u virftp -g virftp -D /home/virftpusers/$1
mkdir /home/virftpusers/$1
mkdir /home/virftpusers/$1/media
chown virftp:virftp /home/virftpusers/$1/ -R
mount –bind /mnt/500SATA/media/ /home/virftpusers/$1/media
pure-pw mkdb

ftpdeluser:
#!/bin/bash
echo Removing FTP user $1
pure-pw userdel $1
umount /home/virftpusers/$1/media
rm -r /home/virftpusers/$1
pure-pw mkdb

No comments: