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,14 +94,19 @@ if [[ "$domains_id" -gt '0' ]] ; then
|
|||
/usr/local/bin/vmail-roundcubemail-settings-export.php $domain
|
||||
fi
|
||||
|
||||
servername=`hostname -f`
|
||||
# output instructions for sycning website to new server, if verbose option was enabled.
|
||||
if [[ -n $verbose ]]; then
|
||||
|
||||
echo
|
||||
echo "Vmail configs for $domain have been exported."
|
||||
echo "To migrate to a new server run these commands (as root) from the new server:"
|
||||
echo
|
||||
echo "rsync -v --archive --relative --rsh=/usr/bin/ssh root@$servername:/var/vmail/$domain /"
|
||||
echo "vmail-domains-imp.sh -d $domain"
|
||||
servername=`hostname -f`
|
||||
|
||||
echo
|
||||
echo "Vmail configs for $domain have been exported."
|
||||
echo "To migrate to a new server run these commands (as root) from the new server:"
|
||||
echo
|
||||
echo "rsync -v --archive --relative --rsh=/usr/bin/ssh root@$servername:/var/vmail/$domain /"
|
||||
echo "vmail-domains-imp.sh -d $domain"
|
||||
|
||||
fi
|
||||
|
||||
else
|
||||
|
||||
|
|
|
@ -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