- CFGFILE="$1"
-
- check_requirements "${CFGFILE}" || {
- echo "Skipping ${CFGFILE}"
- return 1
- }
-
- cat ${CFGFILE} | grep -v "^#" | \
- while read LINE; do
-
- eval `echo "$LINE" | sed -n "s/\(.*\)\ \(.*\) \(.*\)\ \(.*\)\ \(.*\)\ \(.*\)/TTYPE=\1 ; TUSER=\2; TGROUP=\3; TMODE=\4; TNAME=\5 TLTARGET=\6/p"`
-
- [ "${VERBOSE}" != "no" ] && echo "Checking for -${TNAME}-."
-
-
- [ "${TTYPE}" = "l" ] && {
- TSOURCE="$TLTARGET"
- [ -L "${TNAME}" ] || {
- [ "${VERBOSE}" != "no" ] && echo "Creating link -${TNAME}- pointing to -${TSOURCE}-."
- link_file "${TSOURCE}" "${TNAME}" &
- }
- continue
- }
-
- [ -L "${TNAME}" ] && {
- [ "${VERBOSE}" != "no" ] && echo "Found link."
- NEWNAME=`ls -l "${TNAME}" | sed -e 's/^.*-> \(.*\)$/\1/'`
- echo ${NEWNAME} | grep -v "^/" >/dev/null && {
- TNAME="`echo ${TNAME} | sed -e 's@\(.*\)/.*@\1@'`/${NEWNAME}"
- [ "${VERBOSE}" != "no" ] && echo "Converted relative linktarget to absolute path -${TNAME}-."
- } || {
- TNAME="${NEWNAME}"
- [ "${VERBOSE}" != "no" ] && echo "Using absolute link target -${TNAME}-."
- }
- }
-
- case "${TTYPE}" in
- "f") [ "${VERBOSE}" != "no" ] && echo "Creating file -${TNAME}-."
- create_file "${TNAME}" &
- ;;
- "d") [ "${VERBOSE}" != "no" ] && echo "Creating directory -${TNAME}-."
- mk_dir "${TNAME}" &
- # Add check to see if there's an entry in fstab to mount.
- ;;
- *) [ "${VERBOSE}" != "no" ] && echo "Invalid type -${TTYPE}-."
- continue
- ;;
- esac
-
-
- done
-
- return 0