Hello all
i made a simple script that takes users from some domain groups and add them to a local group, when i run it manually it run flawess, but when i set the script to run in the crontab the "for" string doesnt seen to run
Code:
* * * * * /root/add_users.sh
#!/bin/bash
#
#
getent group |awk -F':' '/domain-group-1/{print $4}' > /tmp/users
getent group |awk -F':' '/domain-group-2/{print $4}' >> /tmp/users
getent group |awk -F':' '/domain-group-3/{print $4}' >> /tmp/users
sed 's/,/\n/g' /tmp/users > /tmp/users2
for i in `cat /tmp/users2`
do
{
usermod -a -G localgroup $i
}
done
/var/log/cron shows the script as being run every minute