instalee/handlers/binary/install

12 lines
337 B
Plaintext
Raw Normal View History

2022-07-05 10:41:16 +00:00
#!/bin/sh -e
2022-11-24 14:03:57 +00:00
test "$INSTALEE_VERBOSE" -lt 10 || set -x
arg=$1
2022-11-24 14:03:57 +00:00
name="${2:-$(basename "$arg")}"
location="/usr/local/bin/${name}"
2022-07-05 10:07:18 +00:00
case "$arg" in
2022-11-24 14:03:57 +00:00
(*://*) sudo wget --no-verbose -O "$location" "$arg";;
(*) sudo cp -v "$arg" "$location";;
2022-07-05 10:07:18 +00:00
esac
sudo chmod +x "$location"
test "$INSTALEE_VERBOSE" -lt 3 || echo "Installed $name to $location"