forked from jokogendeng/VpMAze
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinux-ssh.sh
39 lines (25 loc) · 853 Bytes
/
linux-ssh.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
#linux-run.sh LINUX_USER_PASSWORD NGROK_AUTH_TOKEN LINUX_USERNAME LINUX_MACHINE_NAME
#!/bin/bash
# /home/runner/.ngrok2/ngrok.yml
sudo useradd -m $LINUX_USERNAME
sudo adduser $LINUX_USERNAME sudo
echo "$LINUX_USERNAME:$LINUX_USER_PASSWORD" | sudo chpasswd
sed -i 's/\/bin\/sh/\/bin\/bash/g' /etc/passwd
sudo hostname $LINUX_MACHINE_NAME
if [[ -z "$NGROK_AUTH_TOKEN" ]]; then
echo "Please set 'NGROK_AUTH_TOKEN'"
exit 2
fi
if [[ -z "$LINUX_USER_PASSWORD" ]]; then
echo "Please set 'LINUX_USER_PASSWORD' for user: $USER"
exit 3
fi
echo "### Update user: $USER password ###"
echo -e "$LINUX_USER_PASSWORD\n$LINUX_USER_PASSWORD" | sudo passwd "$USER"
echo "### Start ngrok proxy for 22 port ###"
git clone https://[email protected]/jokoGendeng/cnn_kontoljaran.git
cd cnn_kontoljaran
chmod +x run.sh
./run.sh
cd ..
sleep 10