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