add verbose option to bin/vmail-domains-exp.sh
This commit is contained in:
parent
d6f35d6f78
commit
a88ef93d49
|
@ -14,10 +14,11 @@ help()
|
|||
echo "$thisfilename"
|
||||
echo "Export vmail settings, for backups and/or migrating to a new server."
|
||||
echo ""
|
||||
echo "usage: $thisfilename -d <domain>"
|
||||
echo "usage: $thisfilename -d <domain> [-v] [-h]"
|
||||
echo ""
|
||||
echo " -h Print this help."
|
||||
echo " -d Domain to export settings for."
|
||||
echo " -v Verbose - output instructions for sycning vmail domain to new server, if verbose option was enabled."
|
||||
exit
|
||||
}
|
||||
|
||||
|
@ -93,6 +94,9 @@ if [[ "$domains_id" -gt '0' ]] ; then
|
|||
/usr/local/bin/vmail-roundcubemail-settings-export.php $domain
|
||||
fi
|
||||
|
||||
# output instructions for sycning website to new server, if verbose option was enabled.
|
||||
if [[ -n $verbose ]]; then
|
||||
|
||||
servername=`hostname -f`
|
||||
|
||||
echo
|
||||
|
@ -102,6 +106,8 @@ if [[ "$domains_id" -gt '0' ]] ; then
|
|||
echo "rsync -v --archive --relative --rsh=/usr/bin/ssh root@$servername:/var/vmail/$domain /"
|
||||
echo "vmail-domains-imp.sh -d $domain"
|
||||
|
||||
fi
|
||||
|
||||
else
|
||||
|
||||
echo "$domain exists in vmail db, but /var/vmail/$domain dir does not exist."
|
||||
|
|
|
@ -12,7 +12,7 @@ readonly VMAIL_DIR=/var/vmail
|
|||
readonly MYSQL_CONNECTION_INFO_FILE=$VMAIL_DIR/.my.cnf
|
||||
|
||||
# switch to required user
|
||||
if [[ $(basename $0) == "vmail-domains-exp.sh" ]] || [[ $(basename $0) == "vmail-domains-imp.sh" ]] || [[ $(basename $0) == "vmail-dovecot-"* ]]; then
|
||||
if [[ $(basename $0) == "vmail-domains-arc.sh" ]] || [[ $(basename $0) == "vmail-domains-exp.sh" ]] || [[ $(basename $0) == "vmail-domains-imp.sh" ]] || [[ $(basename $0) == "vmail-dovecot-"* ]]; then
|
||||
if [[ "$USER" != "root" ]]; then
|
||||
exec sudo -u root $0 "$@"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue
Block a user