# check that needed todisc deps are installed assert_dep "$todisc_deps" # check if symlink in /tmp exists and use time stamped link if so WORK_DIR="/tmp/todisc-work" for link in $(find /tmp -maxdepth 1 -name todisc-work\* -type l 2>/dev/null ); do [ -h "$link" ] && { WORK_DIR=/tmp/todisc-work$((NUM++)); continue; } done CUR_DIR="$(abspath "$(pwd)")" # make unique REAL_WORK_DIR REAL_WORK_DIR="$CUR_DIR/todisc-work" for dir in "$REAL_WORK_DIR"*; do [ -d "$dir" ] && { REAL_WORK_DIR="$(pwd)"/todisc-work$((NUM++)) continue; } done LOG_FILE="$(abspath "todisc.log")"