-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·51 lines (42 loc) · 1.29 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
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/bash
installPath=/usr/local/bin/uid
echo -e "!! THIS SCRIPT WILL ASK FOR SUDO PERMISSIONS, GIVE IT OR THE SCRIPT WILL ERROR OUT."
if [[ -L "$installPath" ]]; then
echo "You've installed UID with a symlink, Do you want me to remove it? (y/N)"
read yesOrNo1
if [ -z $yesOrNo1 ];
then
echo -e "No input given, You've succesfully bailed out!"
exit 1
fi
if [[ "$yesOrNo1" == "n" ]]; then
echo -e "You'v'e chose not to. You've succesfully bailed out."
exit 1
fi
if [[ "$yesOrNo1" == "y" ]]; then
echo -e "OK. Removing UID..."
sudo unlink "$installPath"
fi
fi
if [ -f "$FILE" ]; then
echo -e "UID already exists! Want me to remove UID and install UID again? (y/N)"
read yesOrNo
if [ -z $yesOrNo ];
then
echo -e "No input given, You've succesfully bailed out!"
exit 1
fi
if [[ "$yesOrNo" == "n" ]]; then
echo -e "You'v'e chose not to. You've succesfully bailed out."
exit 1
fi
if [[ "$yesOrNo" == "y" ]]; then
echo -e "OK. Removing UID..."
sudo rm "$installPath"
fi
fi
echo -e "Building UID..."
source ./publish.sh
echo -e "installing linux-x64 binary to path..."
sudo cp "./publish/linux-x64/uid" "/usr/local/bin/uid"
echo -e "UID installed!"