Magellan Linux

Diff of /mcore-src/trunk/mcore-tools/src/include/daemon.global.class.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2007 by niro, Mon Aug 13 09:42:10 2012 UTC revision 2008 by niro, Mon Aug 13 09:43:26 2012 UTC
# Line 392  set_daemon_mroot() Line 392  set_daemon_mroot()
392   eecho "Path '${path}' does not exist. MROOT not set."   eecho "Path '${path}' does not exist. MROOT not set."
393   fi   fi
394  }  }
395    
396    list_files_in_directory()
397    {
398     local i
399     local retval
400     local path
401     local opts
402     local type
403    
404     # basic getops
405     for i in $*
406     do
407     case $1 in
408     -mindepth) shift; opts+=" -mindepth $1" ;;
409     -maxdepth) shift; opts+=" -maxdepth $1" ;;
410     -type) shift; type="$1" ;;
411     '') continue ;;
412     *) path="$1" ;;
413     esac
414     shift
415     done
416    
417     if [[ -z ${path} ]]
418     then
419     eecho "No path given."
420     return 1
421     fi
422    
423     if [[ ! -d ${path} ]]
424     then
425     eecho "Directory '${path}' does not exist."
426     return 1
427     fi
428    
429     # default to files
430     [[ -z ${type} ]] && type=f
431    
432     for i in $(find ${path} ${opts} -type ${type} | sort)
433     do
434     if [[ -z ${retval} ]]
435     then
436     retval="$(basename ${i})"
437     else
438     retval="${retval} $(basename ${i})"
439     fi
440     done
441    
442     rvecho "${retval}"
443    }

Legend:
Removed from v.2007  
changed lines
  Added in v.2008