diff options
author | jnats <dev@jnats.xyz> | 2021-04-29 18:09:21 +0100 |
---|---|---|
committer | jnats <dev@jnats.xyz> | 2021-04-29 18:09:21 +0100 |
commit | f6d35a69ec5e038a1dee2e99d87681a923bd943a (patch) | |
tree | c42a48d415b9012a5564c4b857c3ddbeae9767f5 | |
parent | 6f90b11409c996c045b21e5093aeb1807c1d4f3e (diff) | |
download | nofetch-f6d35a69ec5e038a1dee2e99d87681a923bd943a.tar.gz nofetch-f6d35a69ec5e038a1dee2e99d87681a923bd943a.tar.bz2 |
made install.sh able to work interchangeably with any of my projects
-rwxr-xr-x | install.sh | 25 |
1 files changed, 13 insertions, 12 deletions
@@ -1,33 +1,34 @@ #!/usr/bin/env bash -FILE=./nofetch +file=nofetch +url=https://raw.githubusercontent.com/jnats/nofetch/main/nofetch -if ! test -f $FILE; +if ! test -f $file; then - curl -LO https://raw.githubusercontent.com/jnats/nofetch/main/nofetch + curl -LO $url fi if [ $EUID -eq 0 ] then echo "[/] uid 0" - rm $(which nofetch > /dev/null 2>&1) > /dev/null 2>&1 - chmod +x nofetch + rm $(which $file > /dev/null 2>&1) > /dev/null 2>&1 + chmod +x $file mkdir -p /usr/local/bin - cp nofetch /usr/local/bin + cp $file /usr/local/bin elif command -v doas &> /dev/null then echo "[/] doas" - doas rm $(which nofetch > /dev/null 2>&1) > /dev/null 2>&1 - chmod +x nofetch + doas rm $(which $file > /dev/null 2>&1) > /dev/null 2>&1 + chmod +x $file doas mkdir -p /usr/local/bin - doas cp nofetch /usr/local/bin + doas cp $file /usr/local/bin elif command -v sudo &> /dev/null then echo "[/] sudo" - sudo rm $(which nofetch > /dev/null 2>&1) > /dev/null 2>&1 - chmod +x nofetch + sudo rm $(which $file > /dev/null 2>&1) > /dev/null 2>&1 + chmod +x $file sudo mkdir -p /usr/local/bin - sudo cp nofetch /usr/local/bin + sudo cp $file /usr/local/bin else echo "\n[X] neither doas nor sudo found, and command isn't running as root, have you checked README.md ?\n" fi |