mirror of
https://github.com/tailscale-dev/deck-tailscale.git
synced 2025-10-22 07:28:14 +00:00
Fix Steam Deck PATH issue with proper detection and adaptive symlinks
- Add proper Steam Deck detection using ID=steamos and VARIANT_ID=steamdeck - Use /home/deck/.local/bin for symlinks on Steam Deck (avoids read-only /usr/local/bin) - Fall back to /usr/local/bin on other systems - Ensure target directories exist before creating symlinks - Add both ~/.local/bin and /opt/tailscale to PATH on Steam Deck - Update uninstall script to clean up symlinks from both locations - Keep profile.d sourcing for immediate availability in current session Fixes #38
This commit is contained in:
20
tailscale.sh
20
tailscale.sh
@@ -65,14 +65,26 @@ chmod +x /opt/tailscale/tailscaled
|
||||
|
||||
# Create symbolic links for PATH access
|
||||
# On Steam Deck, /usr/local/bin is read-only, so use ~/.local/bin instead
|
||||
if [ -f /etc/os-release ] && grep -q "steamdeck" /etc/os-release; then
|
||||
if [ -f /etc/os-release ] && (grep -q "ID=steamos" /etc/os-release || grep -q "VARIANT_ID=steamdeck" /etc/os-release); then
|
||||
# Steam Deck detected - use ~/.local/bin
|
||||
SYMLINK_DIR="/home/deck/.local/bin"
|
||||
mkdir -p "$SYMLINK_DIR"
|
||||
|
||||
# Create the profile script with both paths for Steam Deck
|
||||
if ! test -f /etc/profile.d/tailscale.sh; then
|
||||
echo 'PATH="$PATH:/home/deck/.local/bin:/opt/tailscale"' >> /etc/profile.d/tailscale.sh
|
||||
source /etc/profile.d/tailscale.sh
|
||||
fi
|
||||
else
|
||||
# Other systems - use /usr/local/bin
|
||||
SYMLINK_DIR="/usr/local/bin"
|
||||
mkdir -p "$SYMLINK_DIR"
|
||||
|
||||
# Create the profile script for other systems
|
||||
if ! test -f /etc/profile.d/tailscale.sh; then
|
||||
echo 'PATH="$PATH:/opt/tailscale"' >> /etc/profile.d/tailscale.sh
|
||||
source /etc/profile.d/tailscale.sh
|
||||
fi
|
||||
fi
|
||||
|
||||
# Remove existing symlinks first if they exist
|
||||
@@ -82,12 +94,6 @@ rm -f "$SYMLINK_DIR/tailscale" "$SYMLINK_DIR/tailscaled"
|
||||
ln -s /opt/tailscale/tailscale "$SYMLINK_DIR/tailscale"
|
||||
ln -s /opt/tailscale/tailscaled "$SYMLINK_DIR/tailscaled"
|
||||
|
||||
# Also add to profile.d as fallback for environments where symlink directory isn't in PATH
|
||||
if ! test -f /etc/profile.d/tailscale.sh; then
|
||||
echo 'PATH="$PATH:/opt/tailscale"' >> /etc/profile.d/tailscale.sh
|
||||
source /etc/profile.d/tailscale.sh
|
||||
fi
|
||||
|
||||
# copy the systemd file into place
|
||||
cp -rf $tar_dir/systemd/tailscaled.service /etc/systemd/system/tailscaled.service
|
||||
|
||||
|
Reference in New Issue
Block a user