Cross Reference: i.services
xref
: /
solaris-desktop
/
ext-sources
/
i.services
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
i.services revision 4477
10139
N/A
#!/
bin
/
sh
10139
N/A
#
10139
N/A
# Copyright 2002 Sun Microsystems, Inc. All rights reserved.
10139
N/A
# Use is subject to license terms.
10139
N/A
#
10139
N/A
10139
N/A
F_A
=/
tmp
/
services.add
.$$
10139
N/A
F_M
=/
tmp
/
s.merged
.$$
10139
N/A
10139
N/A
while
read
src
dest
10139
N/A
do
10139
N/A
if
[ ! -f ${
dest
} ]
10139
N/A
then
10139
N/A
cp
-p ${
src
} ${
dest
}
10139
N/A
else
10139
N/A
rm
-f ${
F_A
}
10139
N/A
cat
${
src
} |
10139
N/A
while
read
service
port
rest_of_line
10139
N/A
do
10139
N/A
grep
"^${service}[ ]*${port}[ ]*"
${
dest
} \
10139
N/A
> /
dev
/
null
10139
N/A
if
[ $? !=
0
]
10139
N/A
then
10139
N/A
grep
"^${service}[ ]*${port}[ ]*"
\
10139
N/A
${
src
} >> ${
F_A
}
10139
N/A
fi
10139
N/A
done
10139
N/A
if
[ -s ${
F_A
} ]
10139
N/A
then
10139
N/A
cat
${
dest
} ${
F_A
} > ${
F_M
}
10139
N/A
cp
${
F_M
} ${
dest
}
10139
N/A
rm
-f ${
F_M
}
10139
N/A
fi
10139
N/A
rm
-f ${
F_A
}
10139
N/A
fi
10139
N/A
done
10139
N/A
10139
N/A
exit
0
10139
N/A