--- /dev/null
+#!/bin/sh
+
+set -e
+
+if [ $# -lt 2 -o $# -gt 3 ]
+then
+ echo >&2 \
+'usage: grab-account <localuser> <shorthostname> [<remoteuser>]
+creates an entry in /etc/sync-accounts, and runs sync-accounts
+$Id: grab-account,v 1.1 1999-01-03 00:14:07 ian Exp $'
+ exit 1
+fi
+
+lu="$1"
+sh="$2"
+
+if [ $# -gt 2 ]
+then
+ ru="$3"
+else
+ ru="$1"
+fi
+
+cf=/etc/sync-accounts
+
+if perl -ne 'exit 1 if m/^\s*user\s+'$lu'\s/;' <$cf
+then
+ perl -pe '
+ next unless m/^\s*host\s+'$sh'\s*$/...m/^host|^end/;
+ next unless m/^\s*addhere\s*$/;
+ next if $done++;
+ print "user '$lu'".("'$lu'" eq "'$ru'" ? "" : " remote='$ru'")."\n"
+ or die $!;
+ END {
+ print(STDERR "\`addhere'\'' line not found\n"), $?=1 if !$? && !$done;
+ }
+ ' $cf >$cf.new
+ mv -f $cf.new $cf
+else
+ echo "entry already exists in $cf, leaving alone"
+fi
+
+sync-accounts
#!/usr/bin/perl
+# $Id: sync-accounts,v 1.4 1999-01-03 00:14:07 ian Exp $
# usage: sync-accounts [-n] [-C<config-file>] [<host> ...]
# options:
# -n do not really do anything
--- /dev/null
+#!/bin/sh
+# $Id: sync-accounts-mktar,v 1.1 1999-01-03 00:14:09 ian Exp $
+set -e
+
+of=sync-accounts-usrlocalsbin.tar
+tar vvcf $of sync-accounts sync-accounts-createuser grab-account
+gzip -9v $of