4 if [ $# -ne 4 -a $# -ne 5 ]
5 then echo "Usage: $0 mtreefile TOOL_AWK TOOL_STAT UNPRIV DESTDIR"
15 else DESTDIR
="/" # If not set, default to root (i.e., normal case)
18 cat "$1" |
while read line
20 NF
="`echo $line | ${AWK} '{ print NF }'`"
22 then mode
="`echo $line | ${AWK} '{ print $1 }'`"
23 owner
="`echo $line | ${AWK} '{ print $2 }'`"
24 group
="`echo $line | ${AWK} '{ print $3 }'`"
25 dir
="${DESTDIR}`echo $line | ${AWK} '{ print $4 }'`"
28 targetdev
="`${STAT} -f %d $dir/.`"
29 if [ $targetdev -lt 256 ]
30 then echo "skipping non-dev $dir properties"
31 elif [ $UNPRIV != yes ]
38 then target
="`echo $line | ${AWK} '{ print $3 }'`"
39 linkfile
="${DESTDIR}`echo $line | ${AWK} '{ print $1 }'`"
41 ln -s $target $linkfile