home *** CD-ROM | disk | FTP | other *** search
/ Chip 1995 March / CHIP3.mdf / slackwar / a / util / util-lin.2 / util-lin / util-linux-2.2 / sys-utils / update_state.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1995-02-22  |  1.0 KB  |  42 lines

  1. #!/bin/sh
  2.  
  3. if test "`whoami`" != "root"; then
  4.     echo "This script must be executed by root"
  5.     exit 1
  6. fi
  7.  
  8. if test -x /usr/lib/locate/updatedb; then
  9.     echo "WARNING: The /usr/lib/locate/find.codes file may violate the"
  10.     echo "         privacy of your users.  Please consider making it"
  11.     echo "         readable only by root."
  12.     echo ""
  13.     echo "Updating locate database"
  14.  
  15.     /usr/lib/locate/updatedb
  16. fi
  17.  
  18. if test -d /usr/lib/texmf; then
  19.     echo "Building ls-R cache file for TeX"
  20.     /bin/ls -LR /usr/lib/texmf > /tmp/ls-R.$$
  21.     if test -f /usr/lib/texmf/ls-R; then
  22.         cp /usr/lib/texmf/ls-R /usr/lib/texmf/ls-R.old
  23.     fi
  24.     mv /tmp/ls-R.$$ /usr/lib/texmf/ls-R
  25. fi
  26.  
  27. if test -x /usr/bin/makewhatis; then
  28.     for i in /usr/man /usr/local/man /usr/X386/man /usr/interviews/man; do
  29.         if test -d $i; then
  30.             echo "Building whatis database in $i"
  31.             /usr/bin/makewhatis $i
  32.         fi
  33.     done
  34. fi
  35.  
  36. if test -x /usr/bin/mandb; then
  37.     echo "Updating manpage database"
  38.     /usr/bin/mandb
  39. fi
  40.  
  41. exit 0
  42.