#!/bin/bash
# Crea un paquete autoextraíble en /tmp/autoextrae.run
# Necesita el programa "extrae"

# USO:
# empaqueta ruta1 ruta2 ruta3...


rm /tmp/autoextrae.run
rm /tmp/archivo.tgz
cp /usr/local/bin/extrae /tmp
tar -czvf /tmp/archivo.tgz "$@"

cd /tmp
cat extrae archivo.tgz > autoextrae.run
chmod +x autoextrae.run
#rm archivo.tgz
rm /tmp/extrae
ls /tmp
