-
Notifications
You must be signed in to change notification settings - Fork 14
/
hasselhoff.sh
executable file
·31 lines (29 loc) · 932 Bytes
/
hasselhoff.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
################################
## Platform: Linux & Mac ##
################################
platform="$(uname -s)"
case "${platform}" in
Linux*) machine=linux;;
Darwin*) machine=darwin;;
CYGWIN*) machine=Cygwin;;
MINGW*) machine=MinGw;;
*) machine="UNKNOWN:${platform}"
esac
arch="$(uname -m)"
case "${arch}" in
armv6l) arch=armv6;;
armv7l) arch=armv7;;
*) arch="amd64"
esac
VERSION="0.4.0"
BIN_URL="https://github.com/angelbarrera92/hasselhoffme/releases/download/${VERSION}/hasselhoffme_${VERSION}_${machine}_${arch}"
BINDIR=$(mktemp -d)
cd $BINDIR && curl -s -L $BIN_URL -O
chmod u=rwx $BINDIR/hasselhoffme_${VERSION}_${machine}_${arch}
if [ -z "$DISPLAY" ] && [ "$machine" != "darwin" ];then
sudo $BINDIR/hasselhoffme_${VERSION}_${machine}_${arch} setmotd
else
$BINDIR/hasselhoffme_${VERSION}_${machine}_${arch}
fi
rm -rf $BINDIR