Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[script] Tailscale Switch: Make it switch account without logout #957

Conversation

quatauta
Copy link
Contributor

Description

Update script tailscale-switch.sh to switch to another Tailscale account without logging out of the current account.

With two logged-in Tailscale accounts, the updated script allows switching between the two accounts without any re-authentication (as far as tested for the duration of ~17 hours after login to my accounts).

The script uses tailscale switch --list to list the available accounts. It takes the first not-connected account, and switches to this account with tailscale switch ID.

$ tailscale switch --list
ID    Tailnet                    Account
e163  tailnet-a                  [email protected]
2b13  tailnet-b                  [email protected]
$ tailscale switch 2b13
Switching to account "2b13"
Success.

Type of change

  • New script command
  • Bug fix
  • Improvement of an existing script
  • Documentation update
  • Toolkit change
  • Other (Specify)

Checklist

Update script tailscale-switch.sh to switch to another Tailscale account
without logging out of the current account.

With two logged-in Tailscale accounts, the updated script allows
switching between the two accounts without any re-authentication (as far
as tested for the duration of ~17 hours after login to my accounts).

The script uses `tailscale switch --list` to list the available accounts. It
takes the first not-connected account, and switches to this account with
`tailscale switch ID`.

```console
$ tailscale switch --list
ID    Tailnet                    Account
e163  tailnet-a                  [email protected]
2b13  tailnet-b                  [email protected]
```

```console
$ tailscale switch 2b13
Switching to account "2b13"
Success.
```
@quatauta quatauta marked this pull request as ready for review August 16, 2024 13:52
Copy link
Collaborator

@unnamedd unnamedd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @quatauta 👋

Thanks for the improvements and your first contribution, but don't forget to give yourself some credits in the metadata.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to add credits to yourself too

# @Documentation:
# @raycast.description Switches Tailscale networks

# Original author
# @raycast.author Ross Zurowski
# @raycast.authorURL https://github.com/rosszurowski

# Contributor
# @raycast.author Ross Zurowski
# @raycast.authorURL https://github.com/quatauta

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much @unnamedd ! I added credits in commit 1d6845d.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing!

Copy link
Collaborator

@unnamedd unnamedd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for you contribution @quatauta!

@unnamedd unnamedd added the accepted PR is ready to be merged label Aug 19, 2024
@adilrc adilrc merged commit 70ed227 into raycast:master Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted PR is ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants