Skip to content

Update scripts to be compatible with sh #22

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

Merged
merged 1 commit into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/tailscale/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Tailscale",
"id": "tailscale",
"version": "1.0.3",
"version": "1.0.4",
"description": "Connect to your tailnet in your development container",
"documentationURL": "https://tailscale.com/kb/1160/github-codespaces/",
"licenseURL": "https://github.com/tailscale/codespace/blob/main/LICENSE",
Expand Down
6 changes: 3 additions & 3 deletions src/tailscale/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ set -euo pipefail
tailscale_url="https://pkgs.tailscale.com/stable/tailscale_${VERSION}_amd64.tgz"

download() {
if command -v curl >& /dev/null; then
if command -v curl &> /dev/null; then
curl -fsSL "$1"
elif command -v wget >& /dev/null; then
elif command -v wget &> /dev/null; then
wget -qO - "$1"
else
echo "Must install curl or wget to download $1" 1>&2
echo "Must install curl or wget to download $1" 1&>2
return 1
fi
}
Expand Down
8 changes: 4 additions & 4 deletions src/tailscale/tailscaled-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ if [[ "$(id -u)" -eq 0 ]]; then
--statedir=/workspaces/.tailscale/ \
--socket=/var/run/tailscale/tailscaled.sock \
--port=41641 \
>& /dev/null &
elif command -v sudo >& /dev/null; then
&> /dev/null &
elif command -v sudo &> /dev/null; then
sudo --non-interactive sh -c 'mkdir -p /workspaces/.tailscale ; /usr/local/sbin/tailscaled \
--statedir=/workspaces/.tailscale/ \
--socket=/var/run/tailscale/tailscaled.sock \
--port=41641 >& /dev/null' &
--port=41641 &> /dev/null' &
else
echo "tailscaled could not start as root." 1>&2
echo "tailscaled could not start as root." 1&>2
fi

exec "$@"