forked from snxraven/autoinstallers
55 lines
1.7 KiB
Bash
55 lines
1.7 KiB
Bash
#!/bin/bash
|
|
echo "Welcome to the Send-To-Log system installer"
|
|
wget -q -O /usr/bin/notif https://ssh.surf/notify-x64 && chmod +x /usr/bin/notif
|
|
notif Welcome to the Send-To-Log installer, we will pick a port and provide you a URL when complete.
|
|
|
|
sleep 2
|
|
apt update
|
|
DEBIAN_FRONTEND=noninteractive apt upgrade -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -y
|
|
DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential cmake git libjson-c-dev libwebsockets-dev screen
|
|
|
|
|
|
notif Cloning and Configuring our Software
|
|
|
|
# Move to our tmp directory
|
|
cd /tmp
|
|
# Clone the repo
|
|
git clone https://github.com/tsl0922/ttyd.git
|
|
# Move and build!
|
|
cd ttyd && mkdir build && cd build
|
|
# Install
|
|
cd /tmp/ttyd/build && cmake ..
|
|
cd /tmp/ttyd/build && make && sudo make install
|
|
|
|
# lets download our start up files backend and frontend.
|
|
wget -q -O /etc/systemd/system/s2l.service https://ssh.surf/install/s2l/s2l-service.service
|
|
|
|
wget -q -O /etc/s2l.json https://ssh.surf/install/s2l/s2l-pm2.json
|
|
|
|
wget -q -O /usr/bin/s2l https://ssh.surf/install/s2l/input.sh
|
|
|
|
chmod +x /usr/bin/s2l
|
|
|
|
hostname=$(hostname)
|
|
|
|
echo "Grabbing a port from your container from our API"
|
|
port=$(curl -s https://findport.ssh.surf/?id=$hostname)
|
|
|
|
sed -i "s/changeme/7070/g" /etc/s2l.json
|
|
sed -i "s/#s2lmain/systemctl start s2l && sleep 5/g" /start.sh
|
|
sed -i "s/#s2lsecond/pm2 start \/etc\/s2l.json/g" /start.sh
|
|
cd /
|
|
systemctl start s2l
|
|
sleep 5
|
|
pm2 start /etc/s2l.json
|
|
sleep 10
|
|
relayPort 7070
|
|
sleep 5
|
|
|
|
url=$(grep -hPo "(?<=listening ).*" /root/.pm2/logs/Relay-7070-out.log | head -n 1 | sed 's/$/.virt.fun/')
|
|
|
|
|
|
echo "Done, you may access s2l at https://$url"
|
|
notif Done, you may access s2l at https://$url
|
|
notif Send commands using s2l commandhere or on the bot ^s commandhere
|