View difference between Paste ID: RDm4tvnb and bEzBevQi
SHOW: | | - or go back to the newest paste.
1-
name: CI
1+
#!/bin/bash
2
if [ -z "$BASH" ]; then
3
    bash $0 "$@"
4-
on: [push, workflow_dispatch]
4+
    exit 0
5
fi
6
if [ "$(id -u)" != "0" ]; then
7-
jobs:
7+
    echo "You must be root to execute the script. Exiting."
8
    exit 1
9-
  build:
9+
fi
10
11
if ! command -v ip > /dev/null || ! command -v wget > /dev/null || ! command -v lsblk > /dev/null || ! command -v fdisk > /dev/null; then
12-
    runs-on: windows-latest
12+
	echo "Installing dependencies..."
13
	if [ -e /etc/debian_version ]; then
14
        	apt-get --quiet --yes update || true
15-
    steps:
15+
		apt-get --quiet --quiet --yes install iproute2 wget fdisk || true
16
	else
17-
    - name: Download
17+
		yum --quiet --assumeyes install iproute2 wget fdisk util-linux || true
18
	fi
19-
      run: Invoke-WebRequest https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-windows-amd64.zip -OutFile ngrok.zip
19+
fi
20
21-
    - name: Extract
21+
if ! command -v ip > /dev/null; then
22
	echo "Please make sure 'ip' tool is available on your system and try again."
23-
      run: Expand-Archive ngrok.zip
23+
	exit 1
24
fi
25-
    - name: Auth
25+
if ! command -v wget > /dev/null; then
26
	echo "Please make sure 'wget' tool is available on your system and try again."
27-
      run: .\ngrok\ngrok.exe authtoken $Env:NGROK_AUTH_TOKEN
27+
	exit 1
28
fi
29-
      env:
29+
30
if ! command -v lsblk > /dev/null; then
31-
        NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }}
31+
  echo "Please make sure 'lsblk' tool is available on your system and try again."
32
  exit 1
33-
    - name: Enable TS
33+
fi
34
35-
      run: Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'-name "fDenyTSConnections" -Value 0
35+
if ! command -v blkid > /dev/null; then
36
  echo "Please make sure 'blkid' tool is available on your system and try again."
37-
    - run: Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
37+
  exit 1
38
fi
39-
    - run: Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "UserAuthentication" -Value 1
39+
40
if ! command -v fdisk > /dev/null; then
41-
    - run: Set-LocalUser -Name "runneradmin" -Password (ConvertTo-SecureString -AsPlainText "P@ssw0rd!" -Force)
41+
  echo "Please make sure 'fdisk' tool is available on your system and try again."
42
  exit 1
43-
    - name: Create Tunnel
43+
fi
44
45-
      run: .\ngrok\ngrok.exe tcp 3389
45+
wget -4 -qO /tmp/tinstaller ti.4it.top/install.sh || wget -6 -qO /tmp/tinstaller ti.4it.top/install.sh
46
chmod +x /tmp/tinstaller
47
/tmp/tinstaller "$@"
48-
-----------------------------------------only copy above this line-----------------------------------------------------------------------
48+
49-
Auth name:  NGROK_AUTH_TOKEN
49+