Initial add from Dockers repo

This commit is contained in:
Andrew Cutler
2015-09-25 14:36:57 +10:00
commit 66e60e46e3
8 changed files with 234 additions and 0 deletions

23
add-virtual-user.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -e
[ "$DEBUG" == 'true' ] && set -x
DB=/etc/vsftpd/virtual-users.db
if [ "$#" -lt 2 ] || [ "$#" -gt 3 ]; then
echo "Usage: $0 [-d] <user> <password>" >&2
echo >&2
echo "[ -d ] Delete the database first" >&2
exit 1
fi
if [ "$1" == "-d" ]; then
if [ -f $DB ]; then
rm $DB
fi
shift
fi
echo -e "$1\n$2" | db5.3_load -T -t hash $DB