diff options
author | Michael I. Bushnell <mib@gnu.org> | 1996-07-12 20:49:27 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1996-07-12 20:49:27 +0000 |
commit | b3826b57025371c0ef7e341439d8db236d50a05b (patch) | |
tree | 20df3853a37c29fe2c2f5f672335f1b5637a1f6e /daemons | |
parent | 1b344631e4ca09e11ac376dbba86a9a635cd44ee (diff) |
Only clean /tmp and /var/run if they are respectively directories.
Diffstat (limited to 'daemons')
-rw-r--r-- | daemons/rc.sh | 8 |
1 files changed, 6 insertions, 2 deletions
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... |