Code Sample |
#!/bin/bash # dsl2unc # Just automates Robert's instructions for making a unc extension from a dsl. # WDef Sept `06 help(){ cat <<"EOF" Usage: dsl2unc /PATH/TO/EXTENSION Creates a work dir in /home/dsl New unc is output in /home/dsl EOF exit } #================================================================== . /etc/init.d/dsl-functions # for ANSI colors APP=${1} if [ "$APP" = -h ] || [ "$APP" = --help ] || [ $# -ne 1 ];then help; fi if [ ! -e "${APP}" ]; then echo "Can't find ${APP}"; exit 1; fi if [ ${APP##*.} != dsl ]; then echo "${APP} is not a .dsl extension."; exit 1; fi NAME=$(basename ${APP} .dsl) WORK=${HOME}/$NAME if [ -e "${WORK}" ]; then echo "${WORK} already exists."; exit 1; fi mkdir ${WORK} echo echo "${WHITE}Making ${GREEN}$NAME.unc${WHITE} from ${YELLOW}$NAME.dsl ..${NORMAL}" echo cd ${WORK} tar -zxvf ${APP} find home tmp -type f 2>/dev/null | xargs tar -czvf user.tar.gz 2>/dev/null rm -rf home tmp cd .. mkisofs -R -hide-rr-moved -cache-inodes -pad ${WORK} | create_compressed_fs - 65536 >$NAME.unc || exit 1 echo echo "${GREEN}Finished. Now test your new ${YELLOW}$NAME.unc!${NORMAL}" exit 0 |
Code Sample |
find home opt tmp -type f 2>/dev/null | xargs tar -czvf user.tar.gz 2>/dev/null rm -rf home opt tmp |
Quote |
with contributions such as dsl2unc |
Quote |
if using "-type -f" might limit or even break some extensions. If an extension includes one or more symlinks, or even an empty directory |