From b3826b57025371c0ef7e341439d8db236d50a05b Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Fri, 12 Jul 1996 20:49:27 +0000 Subject: Only clean /tmp and /var/run if they are respectively directories. --- daemons/rc.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'daemons') diff --git a/daemons/rc.sh b/daemons/rc.sh index 5d0eb0ae..a97c3723 100644 --- a/daemons/rc.sh +++ b/daemons/rc.sh @@ -50,8 +50,12 @@ test -r /etc/hostname && hostname `cat /etc/hostname` echo -n cleaning up left over files... rm -f /etc/nologin rm -f /var/lock/LCK.* -(cd /tmp; find . ! -name . ! -name lost+found ! -name quotas -exec rm -r {} \; ) -(cd /var/run && { rm -rf -- *; cp /dev/null utmp; chmod 644 utmp; }) +if test -d /tmp; then + (cd /tmp; find . ! -name . ! -name lost+found ! -name quotas -exec rm -r {} \; ) +fi +if test -d /var/run; then + (cd /var/run && { rm -rf -- *; cp /dev/null utmp; chmod 644 utmp; }) +fi echo done #echo -n restoring pty permissions... -- cgit v1.2.3