1605 |
then |
then |
1606 |
if ! mcheckemptydir ${MAGEDIR} |
if ! mcheckemptydir ${MAGEDIR} |
1607 |
then |
then |
1608 |
find ${MAGEDIR} -mindepth 1 -maxdepth 1 | xarg --no-run-if-empty rm -r |
find ${MAGEDIR} -mindepth 1 -maxdepth 1 | xargs --no-run-if-empty rm -r |
1609 |
fi |
fi |
1610 |
else |
else |
1611 |
rm -rf ${MAGEDIR} |
rm -rf ${MAGEDIR} |
1887 |
count="$(echo ${oldprotected} | sed 's:.*\/._cfg\(.*\)_.*:\1:')" |
count="$(echo ${oldprotected} | sed 's:.*\/._cfg\(.*\)_.*:\1:')" |
1888 |
done |
done |
1889 |
|
|
1890 |
# dirty hack to convert 0001 -> 1; 0120 -> 120 etc |
# convert 0001 -> 1; 0120 -> 120 etc |
1891 |
x="${#count}" |
# use bash internal base functions to this task |
1892 |
|
x="$((10#${count}))" |
1893 |
for (( i=0; i<x; i++ )) |
for (( i=0; i<x; i++ )) |
1894 |
do |
do |
1895 |
if [[ ${count:${i}:1} != 0 ]] |
if [[ ${count:${i}:1} != 0 ]] |