From 317a28f645a578125c9a3782ac99964a025d0e23 Mon Sep 17 00:00:00 2001 From: ian Date: Sun, 3 Jan 1999 00:14:07 +0000 Subject: [PATCH] tarfile-maker, grab-account, rcsids --- sync-accounts/grab-account | 43 ++++++++++++++++++++++++++ sync-accounts/sync-accounts | 1 + sync-accounts/sync-accounts-createuser | 1 + sync-accounts/sync-accounts-mktar | 7 +++++ 4 files changed, 52 insertions(+) create mode 100755 sync-accounts/grab-account create mode 100755 sync-accounts/sync-accounts-mktar diff --git a/sync-accounts/grab-account b/sync-accounts/grab-account new file mode 100755 index 0000000..2eef468 --- /dev/null +++ b/sync-accounts/grab-account @@ -0,0 +1,43 @@ +#!/bin/sh + +set -e + +if [ $# -lt 2 -o $# -gt 3 ] +then + echo >&2 \ +'usage: grab-account [] +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 diff --git a/sync-accounts/sync-accounts b/sync-accounts/sync-accounts index a1b1493..70a9e76 100755 --- a/sync-accounts/sync-accounts +++ b/sync-accounts/sync-accounts @@ -1,4 +1,5 @@ #!/usr/bin/perl +# $Id: sync-accounts,v 1.4 1999-01-03 00:14:07 ian Exp $ # usage: sync-accounts [-n] [-C] [ ...] # options: # -n do not really do anything diff --git a/sync-accounts/sync-accounts-createuser b/sync-accounts/sync-accounts-createuser index 4959dbe..8377db4 100755 --- a/sync-accounts/sync-accounts-createuser +++ b/sync-accounts/sync-accounts-createuser @@ -1,5 +1,6 @@ #!/bin/sh # default user-creation script for sync-accounts +# $Id: sync-accounts-createuser,v 1.2 1999-01-03 00:14:08 ian Exp $ set -e mkdir -p $SYNCUSER_CREATE_HOME diff --git a/sync-accounts/sync-accounts-mktar b/sync-accounts/sync-accounts-mktar new file mode 100755 index 0000000..63ab084 --- /dev/null +++ b/sync-accounts/sync-accounts-mktar @@ -0,0 +1,7 @@ +#!/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 -- 2.30.2