home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / etc / vinegar < prev   
Encoding:
Text File  |  1994-08-05  |  2.3 KB  |  104 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="CONTENTS DIRS.LIST INSTALL.NOTES LINKS.LIST README RELEASE.NOTES \
  50.     audio bin custom etc games include info interviews lib man pics \
  51.     src tls usr xc"
  52. #
  53. # clean up the X11 app-defaults directory
  54. #
  55. [ -d $APPDEFDIR ] && {
  56.     cd $APPDEFDIR
  57.     for i in $MOUNT_PT/lib/X11/app-defaults/*
  58.     do
  59.         [ "$i" = "$MOUNT_PT/lib/X11/app-defaults/XMcd" ] && continue
  60.         Remove_Symlink `basename $i`
  61.     done
  62. }
  63. CHAPPDEFDIR=/usr/lib/charm/app-defaults
  64. #
  65. # clean up the Charm app-defaults directory
  66. #
  67. [ -d $CHAPPDEFDIR ] && {
  68.     cd $CHAPPDEFDIR
  69.     for i in $MOUNT_PT/lib/charm/app-defaults/*
  70.     do
  71.         Remove_Symlink `basename $i`
  72.     done
  73. }
  74. STARTUPDIR=/usr/lib/X11/sco/startup
  75. #
  76. # clean up the SCO startup directory
  77. #
  78. [ -d $STARTUPDIR ] && {
  79.     cd $STARTUPDIR
  80.     for i in $MOUNT_PT/lib/X11/sco/startup/*
  81.     do
  82.         Remove_Symlink `basename $i`
  83.     done
  84. }
  85.  
  86. #
  87. # clean up the Interviews directory
  88. #
  89. Remove_Symlink /interviews
  90.  
  91. #
  92. # set up directory links in /usr/local/lib (for now)
  93. #
  94. LOCALLIBDIRS="g++include gcc-lib povray sc-6.21 xboing/levels xc xconq"
  95. LOCALLIBFILS="libg++.a"
  96. for i in $LOCALLIBDIRS
  97. do
  98.     Remove_Symlink /usr/local/lib/$i
  99. done
  100. for i in $LOCALLIBFILS
  101. do
  102.     Remove_Symlink /usr/local/lib/$i
  103. done
  104.