2022-11-24 15:03:57 +01:00
|
|
|
#!/bin/sh -e
|
2022-02-08 15:57:42 +01:00
|
|
|
# Install a package from a local or downloaded .deb-file and remove it
|
2022-11-24 15:03:57 +01:00
|
|
|
# Can also infer a latest github release
|
|
|
|
loc="$(basename "$1")"
|
2022-07-04 23:14:58 +02:00
|
|
|
case "$1" in
|
2022-11-24 15:03:57 +01:00
|
|
|
(http*) wget --no-verbose -O "$loc" "$@";;
|
|
|
|
(*.deb) loc="$1";;
|
|
|
|
(git*) domain="$1"; shift
|
|
|
|
result=$(curl -s "https://api.$domain/repos/$1/$2/releases/latest" | grep -o "http.*${3:-deb}" | awk '{ print length(), $0}' | sort -n | cut -d' ' -f2-)
|
|
|
|
"$0" $(echo "$result" | command grep amd64 | head -1 || echo "$result")
|
|
|
|
exit $?;;
|
2022-02-08 15:57:42 +01:00
|
|
|
esac
|
|
|
|
sudo dpkg -i "$loc"
|
2022-12-16 18:43:58 +00:00
|
|
|
sudo apt-get -f install
|
2022-09-10 00:05:02 +02:00
|
|
|
sudo rm -v "$loc"
|