Skip to content

Instantly share code, notes, and snippets.

@Filirom1
Created November 9, 2016 17:47
Show Gist options
  • Save Filirom1/4229180154c49ae2c66a7c91be93424b to your computer and use it in GitHub Desktop.
Save Filirom1/4229180154c49ae2c66a7c91be93424b to your computer and use it in GitHub Desktop.
Script that unpack a WAR
#!/bin/bash
if [ "$#" -eq 0 ]; then
echo "Usage: unpackWAR war_file destination"
echo "Usage: curl -L war_url | unpackWAR destination"
elif [ "$#" -eq 1 ]; then
DEST=$1
mkdir -p $DEST
cat /dev/stdin | bsdtar -xvf - -C $DEST
elif [ "$#" -eq 2 ]; then
WAR=$1
DEST=$2
mkdir -p $DEST
bsdtar -C $DEST -xvf $WAR
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment