Skip to content

Commit

Permalink
better install and update scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
beni69 committed Aug 30, 2023
1 parent 9f22ca6 commit a0e042b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
35 changes: 35 additions & 0 deletions misc/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/sh
# https://stackoverflow.com/a/20816534
SCRIPTNAME="${0##*/}"
warn() {
printf >&2 "$SCRIPTNAME: $*\n"
}
iscmd() {
command -v >&- "$@"
}
checkdeps() {
local -i not_found
for cmd; do
iscmd "$cmd" || {
warn $"$cmd is not found"
let not_found++
}
done
(( not_found == 0 )) || {
warn $"Install dependencies listed above to use $SCRIPTNAME"
exit 1
}
}

checkdeps wget unzip chmod systemctl

chmod +x misc/update.sh
./misc/update.sh
touch env

cd misc
mkdir -vp ~/.config/systemd/user/
ln -sv $PWD/csengo.service ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable --now csengo.service
systemctl --user status csengo.service
4 changes: 2 additions & 2 deletions misc/update.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/sh
set -e

rm -v csengo-x86_64-unknown-linux-gnu.zip
rm -vf csengo-x86_64-unknown-linux-gnu.zip
wget https://nightly.link/beni69/csengo/workflows/ci/main/csengo-x86_64-unknown-linux-gnu.zip

rm -v csengo
rm -vf csengo
unzip csengo-x86_64-unknown-linux-gnu.zip
chmod +x ./csengo

Expand Down

0 comments on commit a0e042b

Please sign in to comment.