aboutsummaryrefslogtreecommitdiffstats
path: root/urnstart
blob: 4883b016a3e52d71c0132709bd1e335f00543dd8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
echo "what we're working on:" "$1"
urn="$(printf '%s\n' "$1" | cut -d: -f1)"
if [ "$urn" != "urn" ];then
  echo "this isn't a urn. wtf are you waking me up for? I'm going back to bed. fuck this shit."
  exit 1
fi

nid="$(printf '%s\n' "$1" | cut -d: -f2)"
nss="$(printf '%s\n' "$1" | cut -d: -f3)"
nss2="$(printf '%s\n' "$1" | cut -d: -f4-)"

if [ "$nid" = "anonet" ];then
  if [ "$nss" = "asn" ];then
    uristart "whois://whois.ano/AS${nss2}"
  elif [ "$nss" = "ip4" -o "$nss" = "ip6" -o "$nss" = "dom" ];then
    uristart "whois://whois.ano/${nss2}"
  fi
fi

if [ "$nid" = "ietf" ];then
  if [ "$nss" = "rfc" ];then
    uristart "https://tools.ietf.org/html/rfc""${nss2}"
  fi
fi