-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.txt
96 lines (82 loc) · 2.63 KB
/
install.txt
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
echo `# <#`
# Bash goes here
if [ $(id -u) = 0 ]; then
echo "Please run as non-root user"
exit 1
fi
arch=$(uname -m)
case $arch in
x86_64) arch=amd64 ;;
i686) arch=386 ;;
aarch64) arch=arm64 ;;
*) echo "Unknown architecture $arch"; exit 1 ;;
esac
os=$(uname -s)
case $os in
Linux*) os=linux ;;
Darwin*) os=darwin ;;
*) echo "Unknown OS $os"; exit 1 ;;
esac
echo "Killing existing tailscale-systray"
killall tailscale-systray > /dev/null 2>&1
uri="https://github.com/C10udburst/tailscale-systray/releases/download/latest/tailscale-systray-$os-$arch"
mkdir -p ~/.local/bin
curl -L -o ~/.local/bin/tailscale-systray $uri
chmod +x ~/.local/bin/tailscale-systray
# Add to startup
if [ $os = "linux" ]; then
echo "Adding to startup ~/.config/autostart/tailscale-systray.desktop"
mkdir -p ~/.config/autostart
cat > ~/.config/autostart/tailscale-systray.desktop <<EOF
[Desktop Entry]
Type=Application
Exec=$HOME/.local/bin/tailscale-systray
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=Tailscale Systray
EOF
nohup ~/.local/bin/tailscale-systray > /dev/null 2>&1 &
elif [ $os = "darwin" ]; then
echo "Adding to startup ~/Library/LaunchAgents/com.tailscale.tailscale-systray.plist"
mkdir -p ~/Library/LaunchAgents
cat > ~/Library/LaunchAgents/com.tailscale.tailscale-systray.plist <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.tailscale.tailscale-systray</string>
<key>ProgramArguments</key>
<array><string>$HOME/.local/bin/tailscale-systray</string></array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
EOF
launchctl load ~/Library/LaunchAgents/com.tailscale.tailscale-systray.plist
launchctl start com.tailscale.tailscale-systray
fi
# Set operator to current user
if [ $os = "linux" ]; then
echo "Setting tailscale operator to $(whoami)"
sudo tailscale set --operator $(whoami)
fi
exit
#> > $null
# PowerShell goes here
$ARCH = $env:PROCESSOR_ARCHITECTURE
if ($ARCH -eq "AMD64") {
$ARCH = "amd64"
} elseif ($ARCH -eq "x86") {
$ARCH = "386"
} elseif ($ARCH -eq "ARM64") {
$ARCH = "arm64"
} else {
throw "Unknown architecture $ARCH"
}
$uri = "https://github.com/C10udburst/tailscale-systray/releases/download/latest/tailscale-systray-windows-$ARCH.exe"
$shellStartup = [Environment]::GetFolderPath("Startup")
Invoke-WebRequest -Uri $uri -OutFile "$shellStartup\tailscale-systray.exe"
Start-Process "$shellStartup\tailscale-systray.exe"