-
Notifications
You must be signed in to change notification settings - Fork 1
/
install_cloak.sh
executable file
·39 lines (35 loc) · 989 Bytes
/
install_cloak.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
#!/bin/sh -e
#Author: Jason Campisi
#Date: 9/25/2016
#version 0.2.5
#Released under the GPL v2 or higher
NAME="cloak"
EXT="sh"
FILE="$NAME.$EXT"
LOCATION="/opt/local/bin/"
echo "$FILE installer:";
echo " Checking if '$FILE' exists in the current folder..."
if [ ! -n "$FILE" ]; then
echo " Error - Filename is not set!"
exit 1;
elif [ ! -e "$FILE" ]; then
echo " Error - The location of '$FILE' does not exist!"
exit 1;
fi
echo " ...found!";
echo " Setting file to executable...";
chmod +x ./$FILE
echo " Checking if you have the clearance to install this ...";
if [ "$(whoami)" != 'root' ]; then
echo " You do not have permission to install './$FILE'";
echo " ->You must be a root user.";
echo " ->Try instead: sudo $0";
exit 1;
else
echo " Root access granted for $0";
fi
echo " Installing $NAME to $LOCATION ...";
cp ./$FILE $LOCATION$NAME
echo " Setup complete."
echo "Testing install with this command\n>$NAME --version";
$NAME --version