fix user for vmail-domains-imp.sh

This commit is contained in:
Matthew Saunders Brown 2023-01-02 11:58:11 -08:00
parent 12c6cd39b1
commit 9ddd4a3d6b

View File

@ -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" ]]; then
if [[ $(basename $0) == "vmail-domains-exp.sh" ]] || [[ $(basename $0) == "vmail-domains-imp.sh" ]]; then
if [[ "$USER" != "root" ]]; then
exec sudo -u root $0 "$@"
fi