summaryrefslogtreecommitdiffstats
path: root/build_tools/larch7/larch0/buildscripts/cleardir
blob: a90f0f7219523436c745111c426fde9ee1f200e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh

if  cat /proc/mounts | grep " $1/sys" &>/dev/null; then
    umount -l "$1/sys"
fi
if  cat /proc/mounts | grep " $1/proc" &>/dev/null; then
    umount -l "$1/proc"
fi

if ls "$1" &>/dev/null; then
    rm -rf "$1/*"
fi
for x in $( ls -A "$1" ); do
    rm -rf "$1/$x"
done