Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/bash
- # Links the Oracle Java applet browser plugin to a boatload of browsers.
- #
- # Be sure the JAVA_INST_DIR, PLUGIN_PATH, and PLUGIN_NAME are set
- # correctly. Run as root.
- #
- # Mithat Konar 2011-11-23
- ### config ###
- JAVA_INST_DIR="/opt/java/jre"
- PLUGIN_PATH="$JAVA_INST_DIR/lib/i386" # directory containing plugin
- PLUGIN_NAME="libnpjp2.so" # actual name (w/extension) of plugin
- PLUGIN_DIRS="/usr/lib/firefox/plugins \
- /usr/lib/iceape/plugins \
- /usr/lib/iceweasel/plugins \
- /usr/lib/midbrowser/plugins \
- /usr/lib/mozilla/plugins \
- /usr/lib/xulrunner-addons/plugins \
- /usr/lib/xulrunner/plugins"
- ### end config ###
- ### MAIN ###
- PLUGIN_SOURCE="$PLUGIN_PATH/$PLUGIN_NAME"
- # confirm that plugin is available
- if [[ ! -e $PLUGIN_SOURCE ]] ; then
- echo "Plugin '$PLUGIN_SOURCE' not found. Exiting." 1>&2
- exit 1
- else
- echo "Found plugin '$PLUGIN_SOURCE'"
- fi
- # make the links
- for the_dir in $PLUGIN_DIRS
- do
- if [[ -d "$the_dir" ]]; then
- echo "Making link in $the_dir ..."
- ln -s "$PLUGIN_SOURCE" $the_dir/$PLUGIN_NAME
- #~ echo "removing link in $the_dir ..."
- #~ rm $the_dir/$PLUGIN_NAME
- else
- echo "Directory '$the_dir' not found" 1>&2
- fi
- done
- echo "Done."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement