view scripts/add_dom @ 819:f1f0ab9d41b7 draft

i changed the she-bang on configure from sh to bash because it keeps giving people trouble: /CA/pikaj00> ./configure: 132: Bad substitution /CA/pikaj00> root@pikaj00-M-7323U:/services/ircd/resdb# /relayhell/d3v11> use /relayhell/d3v11> bash configure /relayhell/d3v11> did you run that command on slackware? /relayhell/d3v11> ./configure? /CA/pikaj00> sorry /CA/pikaj00> one sec /CA/pikaj00> yes /relayhell/d3v11> LOL /relayhell/d3v11> then the problem is not ubuntu or debian /CA/shuttle> =) /relayhell/d3v11> if slackware has the same problem /CA/pikaj00> bash /CA/shuttle> what do you think pik /CA/pikaj00> worked
author d3v11 <d3v11@d3v11.ano>
date Sat, 10 Dec 2011 22:23:18 +0000
parents 31e3b4edf502
children c6666d29e9c6 f0ffda736b12
line wrap: on
line source

#!/bin/sh

if [ x"$2" = x ]; then
 echo "Usage: $0 <dom> <owner> [<ns[/nsip]>...]" >&2; exit 255
fi

dir=db/dom/"$(echo "$1" | tr . '\n' | tac | tr '\n' / | head -c -1)"
mkdir "$dir" || exit 1
echo "$2" > "$dir/owner"
mkdir "$dir/ns" || exit 1
shift; shift;
while [ x"$1" != x ]; do
 echo "$1" | tr / ' ' | (
  read ns nsip
  echo "$nsip" > "$dir/ns/$ns"
 )
 shift;
done