-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
39 lines (37 loc) · 1.06 KB
/
install.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
32
33
34
35
36
37
38
39
#!/usr/bin/env bash
lastrelease=$(curl --silent https://api.github.com/repos/akmey/akmey-client/releases/latest|grep tag_name|cut -c 16-|sed 's/.\{2\}$//')
OSTYPE=$(uname)
OSARCH=$(uname -m)
if [ "$EUID" -ne 0 ]; then
isroot=false
else
isroot=true
fi
if [[ $OSARCH == "x86_64" ]]; then
OSARCH="amd64"
fi
if [[ $OSTYPE == "Darwin" ]]; then
OSTYPE="darwin-10.6"
fi
echo "https://github.com/akmey/akmey-client/releases/download/$lastrelease/akmey-client-$OSTYPE-$OSARCH"
curl -L -o akmey "https://github.com/akmey/akmey-client/releases/download/$lastrelease/akmey-client-$OSTYPE-$OSARCH"
chmod +x akmey
if [[ $isroot == "false" ]]; then
read -r -p "Do you want to move Akmey to /usr/bin? (needs sudo if ran as user) [y/N] " response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]
then
sudo mv akmey /usr/bin
echo "Akmey is now installed at /usr/bin/akmey 🚀"
else
exit
fi
else
read -r -p "Do you want to move Akmey to /usr/bin? [y/N] " response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]
then
mv akmey /usr/bin
echo "Akmey is now installed at /usr/bin/akmey 🚀"
else
exit
fi
fi