I need to write a shell script that would:
-check if a specified directory exists and contains any files
-chmod and chown all files inside the directory
-execute all shell scripts in that directory (*.sh)
That script would be run by Cron using root account.
So far I came up with something like this:
if [ -d $katalog ]; then
chmod -R 700 /var/scripts
for SCRIPT in $katalog
if [ -f $SCRIPT -a -x $SCRIPT ]
echo "ERROR! The directory doesn't exist."
Please help me in making it do what it's supposed to do.
Thanks in advance!