-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpart2
More file actions
executable file
·52 lines (36 loc) · 999 Bytes
/
part2
File metadata and controls
executable file
·52 lines (36 loc) · 999 Bytes
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#! /bin/sh
SH=/bin/sh
MV=/bin/mv
TEST=/usr/bin/test
ECHO=/bin/echo
AWK=/bin/awk
RM=/bin/rm
# file1 will have format:
# user machine_name
grep RHOSTS Success | awk '{print $4}' | tr '@' ' ' > file1
lines=1
while $TEST "1"
do
rline=`$AWK '{if (NR=="'$lines'") print $0}' file1`
lines=`expr $lines + 1`
if $TEST -z "$rline"; then
break;
fi
r_user=`$ECHO $rline | $AWK '{print $1}'`
r_machine=`$ECHO $rline | $AWK '{print $2}'`
./add_R_users $r_user $r_machine ## use r_machine as a file name
## and append r_user to this file
done
machine_lists=`ls -1 temp_dir_`
for machine in $machine_lists
do # client sends a file containing remote user names to server
./k_client $machine temp_dir_/$machine
done
#============ READ SUCCESS FILES AND APPEND TO A SINGLE FILE "Success" =========
machine_lists=`ls -1 temp_dir_`
for machine in $machine_lists
do
./process_success_files $machine
done
# remove temp files
rm -rf file1 temp_dir_