mirror of
https://github.com/notwa/rc
synced 2024-06-29 02:17:12 -07:00
15 lines
254 B
Bash
Executable File
15 lines
254 B
Bash
Executable File
#!/usr/bin/zsh
|
|
# YES_ZSH
|
|
# NO_BASH
|
|
# NO_DASH
|
|
|
|
# TODO: damned substrings. rewrite to be semi-portable.
|
|
|
|
isup() {
|
|
local c
|
|
curl -sLI -w '%{http_code}' -o /dev/null "$1" | read -r c
|
|
[ "${c:0:1}" -eq 2 ]
|
|
}
|
|
|
|
[ "${SOURCING:-0}" -gt 0 ] || isup "$@"
|