i.mailxrc revision 7c478bd95313f5f23a4c958a745db2134aa03244
63f0e65a37b95621334db9ee4ba0cd9d826f5c0fChristian Maeder# CDDL HEADER START
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# The contents of this file are subject to the terms of the
43b4c41fbb07705c9df321221ab9cb9832460407Christian Maeder# Common Development and Distribution License, Version 1.0 only
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# (the "License"). You may not use this file except in compliance
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# with the License.
43b4c41fbb07705c9df321221ab9cb9832460407Christian Maeder# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# or http://www.opensolaris.org/os/licensing.
f4a2a20e49f41b2afa657e5e64d9e349c7faa091Christian Maeder# See the License for the specific language governing permissions
f2f9df2e17e70674f0bf426ed1763c973ee4cde0Christian Maeder# and limitations under the License.
c9a7e6af169a2adfb92f42331cd578065ed83a2bChristian Maeder# When distributing Covered Code, include this CDDL HEADER in each
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# If applicable, add the following below this CDDL HEADER, with the
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# fields enclosed by brackets "[]" replaced with your own identifying
a53841f6d6e86ac751c12a33dc8aadf53f59d977Klaus Luettich# information: Portions Copyright [yyyy] [name of copyright owner]
a53841f6d6e86ac751c12a33dc8aadf53f59d977Klaus Luettich# CDDL HEADER END
68d10d143f29fcff3c637ba24f90e983995ceae6Christian Maeder#ident "%Z%%M% %I% %E% SMI"
01e383014b555bbcf639c0ca60c5810b3eff83c0Christian Maeder# Copyright (c) 1995 by Sun Microsystems, Inc.
3b06e23643a9f65390cb8c1caabe83fa7e87a708Till Mossakowski# All rights reserved.
63f0e65a37b95621334db9ee4ba0cd9d826f5c0fChristian Maeder if [ ! -f $dest ] ; then
6a79849bed67264c396dddb3e9c184bdfc1a1bc9Christian Maeder # determine whether existing etc/mail/mailx.rc file is
63f0e65a37b95621334db9ee4ba0cd9d826f5c0fChristian Maeder # based on the same one being installed. If so, no need
8410667510a76409aca9bb24ff0eda0420088274Christian Maeder # to update it.
b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbbChristian Maeder newrev="`sed -n 's/^.*\(@(#)mailx\.rc.*\)\".*/\1/p' $src`"
ad270004874ce1d0697fb30d7309f180553bb315Christian Maeder sed -n -e 's/^\([^#]*\).*$/\1/p' < $dest > $scrfile
4cb215739e9ab13447fa21162482ebe485b47455Christian Maeder # if either of the following is defined, no need to update.
404166b9366552e9ec5abb87a37c76ec8a815fb7Klaus Luettich if grep 'set[ ][ ]*appenddeadletter' $scrfile \
e593b89bfd4952698dc37feced21cefe869d87a2Christian Maeder # existing /etc/mail/mailx.rc file is based on
63f0e65a37b95621334db9ee4ba0cd9d826f5c0fChristian Maeder # the original installed version
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder echo "# The following 3 settings produce the familiar Solaris behavior." > $txtfile
51d769d55d88dfa88bdf54bee78d8fa85a2deba8Christian Maeder printf "1 c\n# \"%s\"\n.\n1 r %s\nw\nq\n" "$newrev" $txtfile | ed -s $dest