Skip to content

Instantly share code, notes, and snippets.

@Celant
Created July 17, 2017 08:40
Show Gist options
  • Save Celant/f5c2e49d0cee2e1ac06af394e1429a20 to your computer and use it in GitHub Desktop.
Save Celant/f5c2e49d0cee2e1ac06af394e1429a20 to your computer and use it in GitHub Desktop.
./videbcontrol.sh foo.deb
#!/bin/bash
# Credits to https://ubuntuforums.org/showthread.php?t=636724
if [[ -z "$1" ]]; then
echo "Syntax: $0 debfile"
exit 1
fi
DEBFILE="$1"
TMPDIR=`mktemp -d /tmp/deb.XXXXXXXXXX` || exit 1
OUTPUT=`basename "$DEBFILE" .deb`.modfied.deb
if [[ -e "$OUTPUT" ]]; then
echo "$OUTPUT exists."
rm -r "$TMPDIR"
exit 1
fi
dpkg-deb -x "$DEBFILE" "$TMPDIR"
dpkg-deb --control "$DEBFILE" "$TMPDIR"/DEBIAN
if [[ ! -e "$TMPDIR"/DEBIAN/control ]]; then
echo DEBIAN/control not found.
rm -r "$TMPDIR"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment