#!/bin/bash
# Author: Adrian Puente Z. (apuente _at_ hackarandas _dot_ com)
#
# Frontend for the 7zip binary commando line.

if [ $# -eq 0 ]
then
        echo -e "Sintax: $0 [file/directory]"
        exit 0
fi

ARCH=$1
NOM7Z=`echo $ARCH | sed -e 's/\///g' | sed -e 's/^\.*//g'`.7z

echo -e "Compressing: "
7za a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on ${NOM7Z} ${ARCH} && echo -e "DONE\n" || echo -e "ERROR\n"

