home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / bin / vinegar < prev    next >
Encoding:
Text File  |  1995-07-19  |  2.0 KB  |  99 lines

  1. :
  2. # vinegar - script to remove the symbolic links created by spray in 
  3. #        /usr/lib/X11 and /usr/skunk in order to be able to run the software 
  4. #        provided on the SCO Skunkware CD-ROM
  5. #
  6. # Written 05-Aug-94 by rr@sco.com
  7. #
  8. # Usage : vinegar <mount-point>
  9. #         Where <mount-point> is the directory on which the CD-ROM is mounted
  10. #         If mounted on /usr/skunk, no argument is necessary
  11. #
  12.  
  13. usage() {
  14.     echo "Usage: vinegar [mount-point]"
  15.     echo "\tWhere mount-point refers to the directory on which"
  16.     echo "\tthe CD-ROM is mounted. If no arguments are given, it"
  17.     echo "\tis assumed the CD-ROM is mounted on /usr/skunk."
  18.     exit 1
  19. }
  20.  
  21. Remove_Symlink() {
  22.     ls -l $1 | grep $MOUNT_PT > /dev/null && rm -f $1
  23. }
  24.  
  25. [ $# = 0 ] && MOUNT_PT=/usr/skunk
  26.  
  27. [ $# = 1 ] && MOUNT_PT=$1
  28.  
  29. [ $# -gt 1 ] && usage
  30.  
  31. #
  32. # check to see if the user has root privelege
  33. #
  34. fuid=`id`
  35. uid=`echo $fuid | awk ' { print $1 } '`
  36. [ "$uid" = "uid=0(root)" ] || {
  37.     echo "You must have root priveleges to run vinegar."
  38.     usage
  39.     exit 1
  40. }
  41.  
  42. #
  43. # check to make sure the cd is mounted and what we expect is there
  44. #
  45. [ -f $MOUNT_PT/pics/README ] || usage
  46. [ -d $MOUNT_PT/lib/X11/app-defaults ] || usage
  47.  
  48. APPDEFDIR=/usr/lib/X11/app-defaults
  49. SKUNKLIST="README RELEASE.NOTES \
  50.     audio bin cdmt etc games include info interviews lib man pics \
  51.         src tls usr xc"
  52.  
  53. #
  54. # clean up the X11 app-defaults directory
  55. #
  56. [ -d $APPDEFDIR ] && {
  57.     cd $APPDEFDIR
  58.     for i in $MOUNT_PT/lib/X11/app-defaults/*
  59.     do
  60.         [ "$i" = "$MOUNT_PT/lib/X11/app-defaults/XMcd" ] && continue
  61.         Remove_Symlink `basename $i`
  62.     done
  63. }
  64.  
  65. #
  66. # clean up the Fresco DLL's
  67. #
  68. cd $MOUNT_PT/lib
  69. for i in *.so *.so.1.0
  70. do
  71.     Remove_Symlink /usr/lib/$i
  72. done
  73.  
  74. #
  75. # clean up the Willow symlink
  76. #
  77. Remove_Symlink /usr/lib/X11/willow
  78.  
  79. #
  80. # clean up the Periodic uid file
  81. #
  82. Remove_Symlink /usr/lib/X11/uid/periodic.uid
  83.  
  84.  
  85. #
  86. # set up directory links in /usr/local/lib (for now)
  87. #
  88. LOCALLIBDIRS="gcc-lib povray sc-6.21 xboing/levels xc xconq mosaic lynx \
  89.     X11"
  90. LOCALLIBFILS="libg++.a"
  91. for i in $LOCALLIBDIRS
  92. do
  93.     Remove_Symlink /usr/local/lib/$i
  94. done
  95. for i in $LOCALLIBFILS
  96. do
  97.     Remove_Symlink /usr/local/lib/$i
  98. done
  99.