Note: You are viewing an old version of this page. View the current version.

sh <<"EOF"
for I in connects-*
do
  echo ${I}
  J=$(mktemp ${I}.XXXXXXXX)

  # Scrub connect log
  sed -e '
    /[0-9][0-9]\/[0-9][0-9]\/[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]: [0-9 ]/s/\( co.* \)[^ ]*$/\1<hidden>/
  ' ${I} > ${J}

  diff -qr ${I} ${J} || mv ${J} ${I}
  rm -f ${J}
done

for I in commands-*
do
  echo ${I}
  J=$(mktemp ${I}.XXXXXXXX)

  # Scrub connect stanzas
  sed -e '
    /:  co /s/^\(.*):  co [^ ]* \)[^ ]*$/\1<hidden>/;
    /:  con /s/^\(.*):  con [^ ]* \)[^ ]*$/\1<hidden>/;
    /:  connect /s/^\(.*):  connect [^ ]* \)[^ ]*$/\1<hidden>/
  ' ${I} > ${J}

  # Scrub recon/su stanzas
  sed -e '
    /:  recon /s/^\(.*):  recon [^ ]* \)[^ ]*$/\1<hidden>/;
    /:  reconnect /s/^\(.*):  reconnect [^ ]* \)[^ ]*$/\1<hidden>/;
    /:  relog /s/^\(.*):  relog [^ ]* \)[^ ]*$/\1<hidden>/;
    /:  su /s/^\(.*):  su [^ ]* \)[^ ]*$/\1<hidden>/
  ' -i ${J}

  # Scrub @pcreate, @name, @password, @newpassword
  sed -e '
    /:  @pcreate /s/^\(.*):  @pcreate [^= ]*[ =]\+\)[^ ]*$/\1<hidden>/;
    /:  @name me[ =]\+/s/^\(.*):  @name me[ =]\+[^ =]\+[ =]\+\)[^ ]*$/\1<hidden>/;
    /^[0-9\/: ]\{18\} \([^(]\+\)([^:]\+:  @name \1[ =]\+/s/^\(.*):  @name [^ =]\+[ =]\+[^ =]\+[ =]\+\)[^ ]*$/\1<hidden>/;
    /:  @pass /s/^\(.*):  @pass \).*$/\1<hidden>=<hidden>/;
    /:  @passwd /s/^\(.*):  @passwd \).*$/\1<hidden>=<hidden>/;
    /:  @password /s/^\(.*):  @password \).*$/\1<hidden>=<hidden>/;
    /:  @newpasswd /s/^\(.*):  @newpasswd [^= ]*[ =]\+\).*$/\1<hidden>/;
    /:  @newpassword /s/^\(.*):  @newpassword [^= ]*[ =]\+\).*$/\1<hidden>/
  ' -i ${J}

  diff -qr ${I} ${J} || mv ${J} ${I}
  rm -f ${J}
done
EOF