Last active
June 9, 2017 07:58
-
-
Save janxb/5e26afdeed3f42a6bdab to your computer and use it in GitHub Desktop.
A Shell Script for adding additional FTP-Users to Ajenti
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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