Files
buun-stack/utils/justfile
2025-09-12 23:29:52 +09:00

28 lines
805 B
Makefile

set dotenv-filename := ".env.local"
[private]
default:
@just --list --unsorted --list-submodules
# Generate a random password
random-password length='48':
@LC_ALL=C tr -dc 'A-Za-z0-9' < /dev/urandom | fold -w {{length}} | head -n 1
# Check if connection to host and port is possible
check-connection host='' port='':
#!/bin/bash
set -euo pipefail
HOST="{{host}}"
while [ -z "${HOST}" ]; do
HOST=$(gum input --prompt="Host: " --width=80)
done
PORT="{{port}}"
while [ -z "${PORT}" ]; do
PORT=$(gum input --prompt="Port: " --width=80)
done
if ! nc -z -w 1 ${HOST} ${PORT} &>/dev/null; then
echo "Connection to ${HOST}:${PORT} failed"
echo "Execute \`telepresence connect\` if it is in a Kubernetes cluster"
exit 1
fi