Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- for VAR in $@
- do
- x="$VAR"
- shift
- case "$VAR" in
- -o)
- echo -e "[*] Cambiando al directorio $1"
- cd $1
- #shift
- ;;
- -d)
- if [ ! -d $1 ]; then
- mkdir $1
- fi
- target=$1
- #shift
- ;;
- -f)
- filelist=$1
- #shift
- ;;
- --help)
- echo -e "Las opciones son:\n"
- echo -e "\t-d\t\tDonde se generara el parche"
- echo -e "\t-o\t\tDesde donde se copiaran los archivo"
- echo -e "\t-f\t\tRuta del archivo con los cambios"
- echo -e "\t--help\t\tMuestra esta ayuda\n"
- exit
- esac
- done
- while read line
- do
- target_dir=`dirname $line`
- mkdir -p $target/$target_dir
- cp -v $line $target/$target_dir
- done < $filelist
- echo -e "[*] Comprimiendo parche $target"
- tar czf $(dirname "$target")/parche-$(date '+%F').tar.gz $target
- echo -e "[*] Eliminado temporales"
- rm -rf $target
- echo -e "[*] Listo parche terminado..!!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement