Want more features on Pastebin? Sign Up, it's FREE!
Guest

multi pepper.install

By: a guest on May 25th, 2012  |  syntax: None  |  size: 1.55 KB  |  views: 73  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. post_install() {
  2.  
  3. if [ -d /etc/chromium-browser ]; then
  4.  
  5.   if [[ $(cat /etc/chromium-browser/default) == *ppapi* ]]; then
  6.     : # do nothing
  7.   else
  8.     sed -i '/CHROMIUM_FLAGS/s|"$| --ppapi-flash-path=/usr/lib/PepperFlash/libpepflashplayer.so --ppapi-flash-version=11.3.31.103"|' /etc/chromium-browser/default
  9.   fi
  10.  
  11. else
  12.  
  13.   if [[ $(cat /etc/chromium/default) == *ppapi* ]]; then
  14.     : # do nothing
  15.   else
  16.     sed -i '/CHROMIUM_FLAGS/s|"$| --ppapi-flash-path=/usr/lib/PepperFlash/libpepflashplayer.so --ppapi-flash-version=11.3.31.103"|' /etc/chromium/default
  17.   fi
  18.  
  19. fi
  20.  
  21. instructions
  22. }
  23.  
  24. post_upgrade()
  25. {
  26. if [ -d /etc/chromium-browser ]; then
  27.  
  28.   sed -i "s/ppapi-flash-version=.*[0-9]/ppapi-flash-version=11.3.31.103/g" /etc/chromium-browser/default
  29.  
  30. else
  31.  
  32.   sed -i "s/ppapi-flash-version=.*[0-9]/ppapi-flash-version=11.3.31.103/g" /etc/chromium/default
  33.  
  34. fi
  35. }
  36.  
  37. post_remove() {
  38. if [ -d /etc/chromium-browser ]; then
  39.  
  40.   if [ -f /etc/chromium-browser/default ]; then
  41.     sed -i 's| --ppapi-flash-path=/usr/lib/PepperFlash/libpepflashplayer.so --ppapi-flash-version=1.*[0-999]||' /etc/chromium-browser/default
  42.   else
  43.     : # do nothing
  44.   fi
  45.  
  46. else
  47.  
  48.   if [ -f /etc/chromium/default ]; then
  49.     sed -i 's| --ppapi-flash-path=/usr/lib/PepperFlash/libpepflashplayer.so --ppapi-flash-version=1.*[0-999]||' /etc/chromium/default
  50.   else
  51.     : # do nothing
  52.   fi
  53.  
  54. fi
  55. }
  56.  
  57. instructions() {
  58.   /bin/cat << EOF
  59.  
  60. Disable all other flash plugins:
  61. Type chrome://plugins/ in the address bar and press Enter
  62. Click on Details button on the top right
  63. Click on Disable near all the Flash plugins except the first one
  64.  
  65. EOF
  66. }
clone this paste RAW Paste Data