3 |
# loads client classes from $MCLIBDIR |
# loads client classes from $MCLIBDIR |
4 |
load_client_classes() |
load_client_classes() |
5 |
{ |
{ |
6 |
|
local i |
7 |
|
|
8 |
# client specific |
# client specific |
9 |
for i in ${MCLIBDIR}/include/*.client.class |
for i in $(find ${MCLIBDIR}/include -type f -name \*.client.class) |
10 |
do |
do |
11 |
source ${i} || eecho "error loading ${i}" |
source ${i} || eecho "error loading ${i}" |
12 |
done |
done |
105 |
mecho "\tcolors - enable colors" |
mecho "\tcolors - enable colors" |
106 |
mecho "\tquiet - do not print any unecessary messages" |
mecho "\tquiet - do not print any unecessary messages" |
107 |
mecho "\thelp - shows help" |
mecho "\thelp - shows help" |
108 |
|
mecho "\tversion - prints version of the daemon" |
109 |
mecho "\tquit - quits the connection to the server" |
mecho "\tquit - quits the connection to the server" |
110 |
mecho |
mecho |
111 |
mecho "Help topics:" |
mecho "Help topics:" |
411 |
-mindepth) shift; opts+=" -mindepth $1" ;; |
-mindepth) shift; opts+=" -mindepth $1" ;; |
412 |
-maxdepth) shift; opts+=" -maxdepth $1" ;; |
-maxdepth) shift; opts+=" -maxdepth $1" ;; |
413 |
-type) shift; type="$1" ;; |
-type) shift; type="$1" ;; |
414 |
|
-name) shift; opts+=" -name $1" ;; |
415 |
'') continue ;; |
'') continue ;; |
416 |
*) path="$1" ;; |
*) path="$1" ;; |
417 |
esac |
esac |
433 |
# default to files |
# default to files |
434 |
[[ -z ${type} ]] && type=f |
[[ -z ${type} ]] && type=f |
435 |
|
|
436 |
for i in $(find ${path} ${opts} -type ${type} | sort) |
for i in $(find ${path} ${opts} -type ${type} -printf '%f\n' | sort) |
437 |
do |
do |
438 |
if [[ -z ${retval} ]] |
if [[ -z ${retval} ]] |
439 |
then |
then |
440 |
retval="$(basename ${i})" |
retval="${i}" |
441 |
else |
else |
442 |
retval="${retval} $(basename ${i})" |
retval+=" ${i}" |
443 |
fi |
fi |
444 |
done |
done |
445 |
|
|
446 |
rvecho "${retval}" |
rvecho "${retval}" |
447 |
} |
} |
448 |
|
|
449 |
|
print_version() |
450 |
|
{ |
451 |
|
echo "mcored-$(<${MCLIBDIR}/VERSION)" |
452 |
|
} |
453 |
|
|
454 |
|
system_chroot() |
455 |
|
{ |
456 |
|
local cmd="$@" |
457 |
|
if [[ -z ${MROOT} ]] |
458 |
|
then |
459 |
|
echo "system_chroot(): \$MROOT was not set, doing nothing!" |
460 |
|
return 1 |
461 |
|
fi |
462 |
|
if [ ! -d ${MROOT} ] |
463 |
|
then |
464 |
|
eecho "system_chroot(): MROOT='${MROOT}' does not exist." |
465 |
|
return 1 |
466 |
|
fi |
467 |
|
|
468 |
|
chroot ${MROOT} ${cmd} |
469 |
|
} |
470 |
|
|