From 1d2ae28e86dc51400f3623d0fa3797702634f800 Mon Sep 17 00:00:00 2001 From: Matthew Saunders Brown Date: Wed, 10 May 2023 15:33:47 -0700 Subject: [PATCH] autodect write mode --- bin/vhost-exp.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/vhost-exp.sh b/bin/vhost-exp.sh index 264cbf8..467d578 100755 --- a/bin/vhost-exp.sh +++ b/bin/vhost-exp.sh @@ -48,9 +48,11 @@ if [[ -d /srv/www/$domain ]]; then vhost::set-opensslpass password=`echo "$password" | openssl aes-256-cbc -d -a -pass pass:$opensslpass -pbkdf2` fi + write=1 else echo "NOTICE: system users password not autodetected!" password=`/usr/bin/pwgen 12 1` + write=0 fi # create export dir @@ -101,12 +103,12 @@ if [[ -d /srv/www/$domain ]]; then echo "To migrate to a new server run these commands (as root) from the new server:" echo "" - echo "/usr/local/bin/vhost-user-add.sh -u $username -p \"$password\" -w" + echo "/usr/local/bin/vhost-user-add.sh -u $username -p \"$password\" -w $write" if [[ -d /usr/jails/$username ]]; then echo "/usr/local/bin/vhost-user-jail.sh -u $username >/dev/null 2>/dev/null &" fi - echo "/usr/local/bin/vhost-add.sh -d $domain -u $username -w" - echo "/usr/local/bin/vhost-mysql-db-add.sh -d $domain -u $dbuser -p $dbpass -w" + echo "/usr/local/bin/vhost-add.sh -d $domain -u $username" + echo "/usr/local/bin/vhost-mysql-db-add.sh -d $domain -u $dbuser -p $dbpass" servername=`hostname -f` echo "rsync -vn --archive --exclude='.passwd' --rsh=/usr/bin/ssh root@$servername:/home/$username/ /home/$username/"