Ref: 11620005
Title: Changing the NCS Global Password and All Macro References To It
date: 3/7/90

Copyright 3Com Corporation, 1991.  All rights reserved.

The following script changes the global password and all references
to it in all macro files.  It runs on an NCS/AT, NCS/1, or NCS/2.

################################################################
#! /bin/csh
#
#  NAME
#     changepwd
#
#  PURPOSE
#    To change the global password and all the references to it in
#    all macro files.
#
#  USAGE
#     changepwd <old_passwd> <new_passwd>
#
#onintr cleanup
#
if ( $#argv < 2 ) then
      echo "Usage: changepwd <old_passwd> <new_passwd>"
      exit -1
endif
#
setd gpw = \"-$argv[2]\"
#
foreach i (`show mac` )
     echo modifying $i
     show mac -E $i | sed -e 's/^'$argv[1]'$/'$argv[2]'/' > /tmp/mac.$$
     define $i < /tmp/mac.$$
end
#
cleanup:
     rm -f /tmp/mac.$$
##################################################################

