forked from Roni-Carta/cf-bypass
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·50 lines (42 loc) · 1.54 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
#!/bin/bash
check_docker()
{
if [ -z "$(which docker)" ]; then
echo "Docker is not installed. Please install it first."
exit 1
fi
if [ -z "$(docker info)" ]; then
echo "Docker is not running. Please start it first."
exit 1
fi
}
main()
{
# Banner
echo "###############################################################################"
echo "# #"
echo "# This script will install cf-bypass #"
echo "# on your system. #"
echo "# #"
echo "###############################################################################"
check_docker
# Install
echo "Installing cf-bypass..."
docker build . -t cf-bypass
# Install src/run-docker.sh as an alias
# Check if you can write to /usr/local/bin
if [ -w /usr/local/bin ]; then
cp ./src/run-docker.sh /usr/local/bin/cf-bypass
chmod +x /usr/local/bin/cf-bypass
else
echo "You don't have permission to write to /usr/local/bin. Please run this script as root."
exit 1
fi
# Check if cf-bypass is installed correctly
if [ -z "$(cf-bypass)" ]; then
echo "cf-bypass is not installed correctly. Please check the installation instructions."
exit 1
fi
echo -e "\033[32mcf-bypass is installed correctly.\033[0m"
}
main