update to support bubble 0.3.0^, fix various problems and support loading tailscale

This commit is contained in:
iceBear67
2025-09-25 16:40:10 +08:00
parent 86b3d8b97a
commit b3e32f11bc
3 changed files with 51 additions and 39 deletions
+15 -32
View File
@@ -1,9 +1,7 @@
if test -e $BUBBLE_SOCK
echo "Manager capability is detected. Type 'bubble' for help."
end
echo "Type 'bubble' for help."
if test ! -e /usr/bin/docker
echo "Docker is not installed. Type 'install-docker' to install if needed."
if test ! -e /usr/sbin/tailscaled
echo "Tailscale is not installed. Type 'install-tailscale' to install if needed."
end
function exit
@@ -18,31 +16,16 @@ function logout
exit
end
function install-docker
if test -e /usr/bin/docker
echo "Docker is already present at /bin/docker."
return
end
echo "Installing docker in 3s."
sleep 3s
echo "[DOCKER] Updating software registry."
sudo apt-get update
sudo apt-get install ca-certificates
echo "[DOCKER] Updating package manager keyrings"
sudo install -m 0755 -d /etc/apt/keyrings
echo "[DOCKER] Adding trust for docker repository"
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo "[DOCKER] Adding docker repository"
bash -c 'echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null'
sudo apt-get update
echo "[DOCKER] Installing docker"
if sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
echo "[DOCKER] Docker should be installed successfully"
else
echo "Unexpected error."
end
function install-tailscale
if test -f /usr/sbin/tailscaled
echo "Tailscale is already installed at /usr/sbin/tailscaled"
return
end
if curl -fsSL https://tailscale.com/install.sh | sh
echo "[TAILSCALE] Tailscale should be installed successfully. Starting tailscaled..."
sudo nohup /usr/sbin/tailscaled --tun=userspace-networking --socks5-server=localhost:1080 > /dev/null 2>&1 &
echo "Tailscaled is running in background. try running 'tailscale status'"
else
echo "Failed to install tailscale."
end
end