FreeBsd Adobe Flash (shell script)

January 8, 2010

Scripts

#!/bin/sh

#(c) 2008 Sokolov Alexey [TrueBSD Project]

check_file()
{
if [ ! -f $1 ]; then
echo “file $1 not found. Please install port ‘$2′”
exit
fi
}

usage_func() {
echo “usage: flashpluginctl [on | off]”
exit
}

check_file “/usr/local/lib/npapi/linux-flashplugin/libflashplayer.so” “www/linux-flashplugin9″
check_file “/usr/local/bin/nspluginwrapper” “www/nspluginwrapper”

if [ $# -ne 1 ]; then
usage_func
fi

if test “$1″ != “on” -a “$1″ != “off”; then
usage_func
fi

case $1 in
on )
linux_module=`kldstat | grep linux | awk ‘{print $5}’`
if [ "$linux_module" != "linux.ko" ]; then
if [ `whoami` != "root" ]; then
echo “I need root permission for load linux kernel module!”
echo “Please perform ‘kldload linux’ under an root.”
exit
fi
kldload linux
fi
nspluginwrapper -a -r
nspluginwrapper -a -i
printf “\nFlash Plugin for user ‘`whoami`’ enabled\n\n”
;;

off )
nspluginwrapper -a -r
printf “\nFlash Plugin for user ‘`whoami`’ disabled\n\n”
;;
esac

Use:

%flashpluginctl on

code

Flash Plugin for user ‘tuser’ enabled

%flashpluginctl off

Code:

Flash Plugin for user ‘tuser’ disabled

, , , , ,

Trackbacks/Pingbacks

  1. FreeBsd Adobe Flash (shell script) | Flash tutorial | Flash video … | Just linux! - January 9, 2010

    [...] Continued here:  FreeBsd Adobe Flash (shell script) | Flash tutorial | Flash video … [...]

Leave a Reply