diff --git a/bin/vhost-deploy.sh b/bin/vhost-deploy.sh index 5c8083f..a95758d 100755 --- a/bin/vhost-deploy.sh +++ b/bin/vhost-deploy.sh @@ -19,6 +19,7 @@ help() echo " -u Username to use for this virtualhost. Optional, defaults to first 8 alphanumeric characters of virtualhost." echo " -p Password for username. Optional, random password generated if none specified." echo " -j Whether or not to jail the user. Optional, default is to not jail user." + echo " -w Write user & mysql info to files. Warning! This inlcudes the unencrypted passwords." exit } @@ -86,7 +87,11 @@ if ! grep -q "^$username:" /etc/passwd; then password=`/usr/bin/pwgen 12 1` fi # add user - /usr/local/bin/vhost-user-add.sh $username -p "$password" + if [[ -n $write ]]; then + /usr/local/bin/vhost-user-add.sh $username -p "$password" -w + else + /usr/local/bin/vhost-user-add.sh $username -p "$password" + fi # if jail option is set then jail user if [[ -n $jail ]]; then /usr/local/bin/vhost-user-jail.sh $username > /dev/null 2>&1 @@ -97,4 +102,8 @@ fi /usr/local/bin/vhost-add.sh $domain $username > /dev/null 2>&1 # add mysql database -/usr/local/bin/vhost-mysql-db-add.sh $domain > /dev/null 2>&1 +if [[ -n $write ]]; then + /usr/local/bin/vhost-mysql-db-add.sh $domain -w > /dev/null 2>&1 +else + /usr/local/bin/vhost-mysql-db-add.sh $domain > /dev/null 2>&1 +fi