2022-04-18 18:12:06 +02:00
|
|
|
|
2022-06-18 15:02:00 +02:00
|
|
|
store="http://cache.home"
|
2022-04-18 18:12:06 +02:00
|
|
|
|
|
|
|
action="$1"
|
|
|
|
|
|
|
|
function print_help() {
|
|
|
|
printf "Usage:\n"
|
|
|
|
printf " %s [ ping | url ]" "$0"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ -z "${action+x}" ]; then
|
|
|
|
print_help
|
|
|
|
elif [ "$action" = "--ping" ]; then
|
|
|
|
nix store ping --store "$store" --option connect-timeout 1 --option download-attempt 1 2>/dev/null
|
|
|
|
elif [ "$action" = "--url" ]; then
|
|
|
|
printf "%s" "$store"
|
|
|
|
else
|
|
|
|
print_help
|
|
|
|
fi
|