Skip to content

Instantly share code, notes, and snippets.

@bbbenji
Forked from janxb/ajenti_additional_ftp_users.sh
Last active August 29, 2015 14:24
Show Gist options
  • Save bbbenji/76919713e2b35d1dbd12 to your computer and use it in GitHub Desktop.
Save bbbenji/76919713e2b35d1dbd12 to your computer and use it in GitHub Desktop.
Additional FTP users for Ajenti
#!/bin/bash
SET_USERS="usernameone:password:/path/to/web/folder usernametwo:password:/path/to/second/folder"
IFS=' ' read -a USERS <<< "${SET_USERS}"
for SET_USER in ${USERS[@]}; do
IFS=':' read -a USER <<< "${SET_USER}"
NAME=${USER[0]};
PASS=${USER[1]};
DIR=${USER[2]};
(echo $PASS; echo $PASS) | pure-pw useradd $NAME -u www-data -g www-data -d $DIR
done
pure-pw mkdb
# for making supervisord think that process is alive
sleep infinity
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment