aboutsummaryrefslogtreecommitdiff
path: root/install.sh
diff options
context:
space:
mode:
authorjnats <dev@jnats.xyz>2021-04-29 18:09:21 +0100
committerjnats <dev@jnats.xyz>2021-04-29 18:09:21 +0100
commitf6d35a69ec5e038a1dee2e99d87681a923bd943a (patch)
treec42a48d415b9012a5564c4b857c3ddbeae9767f5 /install.sh
parent6f90b11409c996c045b21e5093aeb1807c1d4f3e (diff)
downloadnofetch-f6d35a69ec5e038a1dee2e99d87681a923bd943a.tar.gz
nofetch-f6d35a69ec5e038a1dee2e99d87681a923bd943a.tar.bz2
made install.sh able to work interchangeably with any of my projects
Diffstat (limited to 'install.sh')
-rwxr-xr-xinstall.sh25
1 files changed, 13 insertions, 12 deletions
diff --git a/install.sh b/install.sh
index 1a4d757..3df0831 100755
--- a/install.sh
+++ b/install.sh
@@ -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