25 lines
588 B
Bash
Executable File
25 lines
588 B
Bash
Executable File
#!/bin/bash
|
|
# Author : Ismael Barros² <ismael@barros2.org>
|
|
# License : BSD http://en.wikipedia.org/wiki/BSD_license
|
|
|
|
usage() { echo "$0 <image> <target>"; }
|
|
|
|
image="$1"
|
|
target="${2:-$(basename "$image" .run).AppDir}"
|
|
mountpoint="$(mktemp -d --suffix=_unpackAppImage)"
|
|
|
|
cleanup() { fusermount -u "$mountpoint"; }
|
|
|
|
[ -z "$image" ] && { usage; exit 1; }
|
|
[ -z "$target" ] && { usage; exit 1; }
|
|
|
|
echo "Unpacking \"${image}\" on \"${target}\"..."
|
|
|
|
mkdir -p "$target" || exit 1
|
|
|
|
fuseiso -p "$image" "$mountpoint" || exit 1
|
|
trap cleanup EXIT
|
|
|
|
cp -av "$mountpoint"/* "$target"/ || exit 1
|
|
cleanup
|