fix(handlers): use args rather than stdin

This commit is contained in:
xeruf 2022-07-04 23:14:58 +02:00
parent b8bf73c17e
commit f75d416abe
3 changed files with 4 additions and 6 deletions

View file

@ -1,8 +1,7 @@
#!/bin/sh #!/bin/sh
# Install a package from a local or downloaded .deb-file and remove it # Install a package from a local or downloaded .deb-file and remove it
loc="/tmp/install.deb" loc="/tmp/install.deb"
arg="$(read)" case "$1" in
case "$arg" in
(http*) sudo wget -O "$loc" "$arg";; (http*) sudo wget -O "$loc" "$arg";;
(*) loc="$arg";; (*) loc="$arg";;
esac esac

View file

@ -1,4 +1,3 @@
#!/usr/bin/env sh #!/usr/bin/env sh
arg="$(read)" cd "$1"
cd "$arg"
sudo checkinstall sudo checkinstall

View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
read arg arg=$1
read name name=$2
location="/usr/local/bin/${name:-$(basename "$arg")}" location="/usr/local/bin/${name:-$(basename "$arg")}"
curl "$arg" | sudo tee "$location" > /dev/null curl "$arg" | sudo tee "$location" > /dev/null
sudo chmod +x "$location" sudo chmod +x "$location"