-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Improvements for `tailscale` & `tailscaled` command. * Changed `/data/local/tmp/` to `/data/adb/tailscale/` & Refactor variable name.
- Loading branch information
1 parent
7a36368
commit cb267c2
Showing
7 changed files
with
262 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/system/bin/sh | ||
if echo "$@" | grep -q -- '--socket='; then # if socket is specified, use it | ||
/data/adb/tailscale/bin/tailscale "$@" | ||
else # otherwise, use the default socket | ||
/data/adb/tailscale/bin/tailscale --socket=/data/adb/tailscale/tmp/tailscaled.sock "$@" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/system/bin/sh | ||
if [ $# -eq 0 ]; then # if no arguments are passed, start tailscaled | ||
export PATH=/data/adb/tailscale/bin:$PATH | ||
/data/adb/tailscale/bin/tailscaled -tun=userspace-networking -statedir=/data/adb/tailscale/tmp/ -state=/data/adb/tailscale/tmp/tailscaled.state -socket=/data/adb/tailscale/tmp/tailscaled.sock -port=41641 | ||
else # otherwise, run tailscale with the arguments passed | ||
/data/adb/tailscale/bin/tailscaled "$@" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/system/bin/sh | ||
|
||
# Custom getent script to simulate "getent passwd" for specific users | ||
# Because tailscale ssh need getent command | ||
# Reference : | ||
# - https://github.com/tailscale/tailscale/blob/5812093d31c8a7f9c5e3a455f0fd20dcc011d8cd/util/osuser/user.go#L121C19-L121C33 | ||
case "$1" in | ||
passwd) | ||
case "$2" in | ||
root) | ||
echo "root:x:0:0:root:/:/bin/sh" | ||
;; | ||
*) | ||
echo "User not found" | ||
exit 1 | ||
;; | ||
esac | ||
;; | ||
*) | ||
echo "Unknown getent command" | ||
exit 1 | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rm -rf /data/adb/tailscale |