|
#!/bin/bash
|
|
|
|
echo "Script By zendy"
|
|
echo "This script will install LXDE or Fluxbox and set up ngrok for tunnel and access it using VNC viewer."
|
|
|
|
|
|
install_lxde() {
|
|
apt update
|
|
apt install lxde x11vnc xvfb wget -y
|
|
}
|
|
|
|
|
|
install_fluxbox() {
|
|
apt update
|
|
apt install fluxbox x11vnc xvfb wget -y
|
|
}
|
|
|
|
|
|
echo "Choose desktop environment to install:"
|
|
echo "1. LXDE"
|
|
echo "2. Fluxbox"
|
|
read -p "Enter your choice (1 or 2): " choice
|
|
|
|
case $choice in
|
|
1)
|
|
install_lxde
|
|
start_command="startlxde"
|
|
;;
|
|
2)
|
|
install_fluxbox
|
|
start_command="startfluxbox"
|
|
;;
|
|
*)
|
|
echo "Invalid choice. Exiting."
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
|
|
echo "Downloading ngrok..."
|
|
wget https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz
|
|
tar xf ngrok*
|
|
rm ngrok-*
|
|
|
|
|
|
read -p "Enter your ngrok auth token: " authtoken
|
|
./ngrok authtoken $authtoken
|
|
|
|
|
|
read -p "Enter custom ngrok port (default 23): " ngrok_port
|
|
nohup ./ngrok tcp ${ngrok_port:-23} &
|
|
|
|
|
|
export DISPLAY=:1
|
|
Xvfb $DISPLAY -screen 0 1024x768x16 &
|
|
$start_command &
|
|
|
|
x11vnc -display $DISPLAY -bg -forever -nopw -quiet -listen localhost -xkb -rfbport ${ngrok_port:-23} |