Advertisement
Guest User

java_applet_links.sh

a guest
Nov 23rd, 2011
685
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.20 KB | None | 0 0
  1. #! /bin/bash
  2.  
  3. # Links the Oracle Java applet browser plugin to a boatload of browsers.
  4. #
  5. # Be sure the JAVA_INST_DIR,  PLUGIN_PATH, and PLUGIN_NAME are set
  6. # correctly. Run as root.
  7. #
  8. # Mithat Konar 2011-11-23
  9.  
  10. ### config ###
  11.  
  12. JAVA_INST_DIR="/opt/java/jre"
  13. PLUGIN_PATH="$JAVA_INST_DIR/lib/i386"   # directory containing plugin
  14. PLUGIN_NAME="libnpjp2.so"               # actual name (w/extension) of plugin
  15.  
  16. PLUGIN_DIRS="/usr/lib/firefox/plugins \
  17. /usr/lib/iceape/plugins \
  18. /usr/lib/iceweasel/plugins \
  19. /usr/lib/midbrowser/plugins \
  20. /usr/lib/mozilla/plugins \
  21. /usr/lib/xulrunner-addons/plugins \
  22. /usr/lib/xulrunner/plugins"
  23.  
  24. ### end config ###
  25.  
  26. ### MAIN ###
  27. PLUGIN_SOURCE="$PLUGIN_PATH/$PLUGIN_NAME"
  28.  
  29. # confirm that plugin is available
  30. if [[ ! -e $PLUGIN_SOURCE ]] ; then
  31.     echo "Plugin '$PLUGIN_SOURCE' not found. Exiting." 1>&2
  32.     exit 1
  33. else
  34.     echo "Found plugin '$PLUGIN_SOURCE'"
  35. fi
  36.  
  37. # make the links
  38. for the_dir in $PLUGIN_DIRS
  39. do
  40.     if [[ -d "$the_dir" ]]; then
  41.         echo "Making link in $the_dir ..."
  42.         ln -s "$PLUGIN_SOURCE" $the_dir/$PLUGIN_NAME
  43.         #~ echo "removing link in $the_dir ..."
  44.         #~ rm $the_dir/$PLUGIN_NAME
  45.     else
  46.         echo "Directory '$the_dir' not found" 1>&2
  47.     fi
  48. done
  49.  
  50. echo "Done."
  51.  
  52.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement