Initial ttyd skill
This commit is contained in:
35
scripts/autorun.sh
Normal file
35
scripts/autorun.sh
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
TTYD_VERSION="${TTYD_VERSION:-1.7.7}"
|
||||
|
||||
# Idempotent ttyd installation
|
||||
install_ttyd() {
|
||||
if command -v ttyd &>/dev/null; then
|
||||
echo "ttyd already installed: $(ttyd --version)"
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo "Installing ttyd v${TTYD_VERSION}..."
|
||||
|
||||
# Detect architecture
|
||||
local arch
|
||||
case "$(uname -m)" in
|
||||
x86_64) arch="x86_64" ;;
|
||||
aarch64) arch="aarch64" ;;
|
||||
armv7l) arch="armhf" ;;
|
||||
*)
|
||||
echo "Unsupported architecture: $(uname -m)"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Download prebuilt binary
|
||||
local url="https://github.com/tsl0922/ttyd/releases/download/${TTYD_VERSION}/ttyd.${arch}"
|
||||
curl -sSL "$url" -o /usr/local/bin/ttyd
|
||||
chmod +x /usr/local/bin/ttyd
|
||||
|
||||
echo "ttyd installed: $(ttyd --version)"
|
||||
}
|
||||
|
||||
install_ttyd
|
||||
Reference in New Issue
Block a user