ref: b563ed75504e401dd81f52809efbb9fc960669cd
parent: 062a46607e5be63440604b7f3286aa09d7826d75
author: BurnZeZ <brz-9dev@feline.systems>
date: Mon Oct 3 08:31:48 EDT 2016
iwhois(1): make -n work, add .org, and a couple minor changes
--- a/rc/bin/iwhois
+++ b/rc/bin/iwhois
@@ -1,8 +1,11 @@
#!/bin/rc
# iwhois [-n] domain - print registration data for domain
rfork e
-if (~ $#* 1 && ~ $1 -n)
+noboiler=()
+if (! ~ $#* 0 && ~ $1 -n){
noboiler=yes
+ shift
+}
person=`{echo $1|sed s/@.*//}
fn boilerplate { sed -n '/^[ ]*[A-Za-z][A-Za-z]*:$/,$p' $* }
@@ -38,8 +41,8 @@
machine=whois.dk-hostmaster.dk
fn boilerplate { grep -v '^#' $* }
case *.es
- echo no known whois server for .es
- exit
+ echo no known whois server for .es >[1=2]
+ exit '.es not supported'
case *.fr
machine=whois.nic.fr
fn boilerplate { grep -v '^%%' $* }
@@ -50,6 +53,9 @@
machine=whois.jprs.jp
person=$person^'/e'
fn boilerplate { cat $* }
+case *.org
+ machine=whois.pir.org
+ fn boilerplate { sed '/^>>> Last update of WHOIS database/,$d' $* }
case *.se
machine=whois.nic-se.se
fn boilerplate { grep -v '^#' $* | uniq }
@@ -60,9 +66,9 @@
machine=whois.internic.net # alternate: whois.networksolutions.com
fn boilerplate { cat $* }
}
-if (~ $noboiler yes)
+if(! ~ $#noboiler 0)
fn boilerplate { cat $* }
-file=/tmp/iwhois$pid
+file=/tmp/iwhois.$pid
fn sigexit {
rm -f $file
}
@@ -84,4 +90,3 @@
exit broken
}
boilerplate $file
-rm $file