Script to fix permissions of valiases

hr-ethadmin
Site Admin
Posts: 67
Joined: Fri May 31, 2013 1:04 pm

Script to fix permissions of valiases

Postby hr-ethadmin » Wed Dec 25, 2013 12:35 pm

Hello,

To fix valiases permissions use following shell script.

#!/bin/bash
# Script to fix permissions of valiases


for domain in `cat /etc/userdomains |awk '{print $1}' | grep -v "*" | cut -d: -f1`
do

if ! [ -f /etc/valiases/$domain ]; then
touch /etc/valiases/$domain
fi

user=$(egrep "^$domain:" /etc/userdomains |awk '{print $2}');
chown $user:mail /etc/valiases/$domain
chown $user:mail /etc/vdomainaliases/$domain
chmod 644 /etc/valiases/$domain
chmod 644 /etc/vdomainaliases/$domain
done
------------

Thank you.

Return to “Hostripples dedicated Servers (Linux/Windows)”

Who is online

Users browsing this forum: No registered users and 3 guests