Re: Checking if directory is empty in postrm
>>>>> "Marcus" == Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de> writes:
Marcus> can someone give me a hint how I can efficient test if a
Marcus> certain directory is empty in the postrm (shell script)?
Here's what I did in the /etc/rc.boot/nethack script:
# Are there any lock-files to recover?
ls /var/lib/games/nethack/*lock.0 >/dev/null 2>&1 || exit 0
You can obviously replace the *lock.0 with * if you want to see
if it's completely empty.
--
Brought to you by the letters O and P and the number 16.
"Hello! We are only joke. It is funny enough." -- Orz, SCII
Debian GNU/Linux -- where do you want to go tomorrow? http://www.debian.org/
I'm on FurryMUCK as Che, and EFNet and YiffNet IRC as Che_Fox.
Reply to: