forked from skadakar/taky-docker-installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
oneline.sh
62 lines (50 loc) · 1.74 KB
/
oneline.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
52
53
54
55
56
57
58
59
60
61
62
#/bin/bash
#Getting required software
apt-get update
apt-get upgrade -y
apt-get install zip -y
sudo apt-get install unzip -y
apt-get install docker -y
apt-get install docker-compose -y
#This will be your work folder
cd /root/
#Setting env variables needed for later
hostname=$(hostname)
ip4=$(curl ifconfig.io/ip)
echo "ID="$hostname > .env
echo "IP="$ip4 >> .env
sleep 5s
export $(grep -v '^#' .env | xargs)
sleep 10s
echo "Exported env variables, if blank things will not work!"
echo "ID:" + $ID
echo "IP" + $IP
#Creating folders
mkdir -p /root/taky-data
chgrp 1000 -R /root/taky-data
chown 1000 -R /root/taky-data
#Downloading docker compose template
rm /root/docker-compose.yml
wget https://raw.githubusercontent.com/skadakar/taky-itak/main/docker-compose.yml
docker pull skadakar/taky:0.8.3
#Starting taky servers in docker
echo "Starting everything to generate configs and certs"
docker-compose up -d && sleep 20s
echo "Stopping everything one time to load with config and certs"
docker-compose down --remove-orphans && sleep 20s
echo "Starting taky a finale time"
docker-compose up -d && sleep 20s
#Generating certifiactes and extracting them
echo "Will attempt building the client"
docker exec taky-cot bash -c "cd /data/; takyctl -c /data/conf/taky.conf build_client --is_itak itak" && sleep 10s
docker exec taky-cot bash -c "cd /data/; takyctl -c /data/conf/taky.conf build_client atak" && sleep 10s
#Creating itak package
itaklink=$(curl --upload-file /root/taky-data/itak.zip https://transfer.sh/itak.zip)
ataklink=$(curl --upload-file /root/taky-data/atak.zip https://transfer.sh/atak.zip)
#Post links
echo " "
echo "Download and make copies of the following files for the different platforms"
echo " "
echo "Itak:" $itaklink
echo "Atak:" $ataklink
echo " "