using Fedora 14:

echo 'while true; do sleep 5; if ifconfig | grep "inet addr:" | grep -vq "127.0.0.1"; then if ! mount | grep -q "/home/user/Desktop/Share"; then mount -vvv -t cifs -o ro,noexec,nosuid,nodev,password=,nolock //192.168.1.1/Share /home/user/Desktop/Share; fi; fi; done &' > /etc/rc.d/rc5.d/S99mountsmb
chmod +x /etc/rc.d/rc5.d/S99mountsmb

i mount an anonym Samba share [checks it in every 5 sec]

it's working, ok, great!

But: when i shut down my Fedora box, i can see the lines containing this scripts lines! Many times, about ~50x on the screen.

How could i disable these lines when shutting down? I [and other people] don't want to see those lines for about ~ 5 sec

Thank you!

link|improve this question

62% accept rate
feedback

1 Answer

It seems like you're rolling your own solution for the problem that cron addresses. While it's true that cron won't run every five seconds, you could run a script every minute which runs your code every five seconds.

Within this script and/or the crontab entry, you should redirect stderr to /dev/null (or another log file) --- e.g. my_script.sh > /etc/rc.d/rc5.d/S99mountsmb 2>/dev/null

I don't have a lot of experience with Samba mounts, but I'd guess that there's probably some way to configure the mount to keep itself alive as well.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.