Update FlashPlayer plugins automatically with systemd

Share your own howto's etc. Not for support questions!
Post Reply
Message
Author
User avatar
Head_on_a_Stick
Posts: 13450
Joined: 2014-06-01 17:46
Location: /dev/chair

Update FlashPlayer plugins automatically with systemd

#1 Post by Head_on_a_Stick »

This guide presumes that either Adobe's FlashPlayer or Google's PepperFlashPlayer is already installed and working.

See https://wiki.debian.org/FlashPlayer, https://wiki.debian.org/PepperFlashPlayer & https://wiki.debian.org/Freshplayerplugin

Keeping Adobe's FlashPlayer plugin up to date is very important.

If systemd is used as PID1 (/sbin/init) then a timer can be used to fetch updates daily.

First, create an update script at /usr/local/bin/update-flashplugins (as root!) with the following content:

Code: Select all

#!/bin/sh

NPAPI_FLASH="update-flashplugin-nonfree"
PEPPER_FLASH="update-pepperflashplugin-nonfree"

if type "$NPAPI_FLASH" 1>/dev/null ; then
  "$NPAPI_FLASH" --install --quiet
fi

if type "$PEPPER_FLASH" 1>/dev/null ; then
  "$PEPPER_FLASH" --install --quiet
fi
This script was shamelessly stolen from @twoion over at the old #! forums:
http://crunchbang.org/forums/viewtopic.php?id=33319

Make the script executable with:

Code: Select all

sudo chmod +x /usr/local/bin/update-flashplugins
Then create two custom unit files for systemd:

/etc/systemd/system/update-flashplugins.timer

Code: Select all

[Unit]
Description=Update FlashPlayer plugins daily.

[Timer]
OnCalendar=daily
AccuracySec=1h
Persistent=true

[Install]
WantedBy=timers.target
/etc/systemd/system/update-flashplugins.service

Code: Select all

[Unit]
Description=Update FlashPlayer plugins.

[Service]
Type=oneshot
ExecStartPre=/bin/sleep 600
ExecStart=/usr/local/bin/update-flashplugins
Finally, enable the timer with:

Code: Select all

sudo systemctl enable update-flashplugins.timer
DIsable the timer with:

Code: Select all

sudo systemctl disable update-flashplugins.timer
Check the status with:

Code: Select all

systemctl status update-flashplugins.timer
Which should look something like this:

Code: Select all

empty@TheLab:~$ sudo systemctl status update-flashplugins.timer
● update-flashplugins.timer - Update FlashPlayer plugins daily.
   Loaded: loaded (/etc/systemd/system/update-flashplugins.timer; enabled)
   Active: inactive (dead)
:)
Black Lives Matter

Debian buster-backports ISO image: for new hardware support

Post Reply