#!/bin/bash
# Install tailscale
red='\033[0;31m'
green='\033[0;32m'
blue='\033[0;34m'
yellow='\033[0;33m'
plain='\033[0m'

EXIT_NODE_IP=100.93.3.60
TAILSCALE_AUTH_KEY="tskey-auth-ka45BS2Db611CNTRL-UqqMwnznCoiMYAhyNEy3piYeUNKxevuCe"

current_directory=$(pwd)

# check if tailscale is installed
if ! command -v tailscale &> /dev/null; then
    echo -e "${blue}Tailscale${plain} is not installed. Installing now..."
    # Install tailscale
    curl -fsSL https://tailscale.com/install.sh | sh
    echo -e "${blue}Setting up${plain} tailscale"
    # Setting up tailscale
    nohup tailscaled --tun=userspace-networking > tailscaled.log 2>&1 &
    # serve file
    # sudo tailscale serve /content/drive/MyDrive
    # sudo tailscale serve /content/drive/MyDrive/hello_world
else
    echo -e "${yellow}Tailscale is already installed. Skipping install."
fi

