Script to add & remove Plugins

Moderators: Gully, peteru

Post Reply
dRdoS7
Wizard
Posts: 1097
Joined: Tue Sep 22, 2015 11:47

Script to add & remove Plugins

Post by dRdoS7 » Tue Feb 21, 2017 13:07

Hi,

Tiring of having to manually add (EPGRefresh, Foreca & Merlin Music Player), and remove various unwanted (you know which ones!!) plugins after each USB update. Some are even installed (updated though they've been removed?) in an online update.

I'd like to write a script that I can run once to do the above, it will have 2 effects: add & remove certain plugins, and save me accidentally removing the wrong one/s.

I think, like this:

Code: Select all

#!/bin/sh

opkg install enigma2-plugin-extensions-epgrefresh
opkg install enigma2-plugin-extensions-foreca
opkg install enigma2-plugin-extensions-merlinmusicplayer

opkg uninstall enigma2-plugin-extensions-hbbtv
opkg uninstall enigma2-plugin-extensions-inigmailreader
opkg uninstall enigma2-plugin-extensions-webcamviewer
opkg uninstall enigma2-plugin-extensions-youtube

opkg uninstall enigma2-plugin-systemplugins-icetv

How does that look?

EDIT: Not good: should be remove instead of uninstall!

Can/should I add some sort of error checking?

How do I make sure it has run correctly, can I get, and pause a screen output?

Thanks,

dRdoS7
Last edited by dRdoS7 on Thu Feb 23, 2017 13:47, edited 1 time in total.

dRdoS7
Wizard
Posts: 1097
Joined: Tue Sep 22, 2015 11:47

Re: Script to add & remove Plugins

Post by dRdoS7 » Thu Feb 23, 2017 11:08

Hi,

An update after I tried the first, amended, version:

Code: Select all

#!/bin/sh

opkg install enigma2-plugin-extensions-epgrefresh
opkg install enigma2-plugin-extensions-foreca
opkg install enigma2-plugin-extensions-merlinmusicplayer

opkg remove --force-depends enigma2-plugin-extensions-hbbtv
opkg remove --force-depends enigma2-plugin-extensions-inigmailreader
opkg remove --force-depends enigma2-plugin-extensions-iniwebcamviewer

opkg remove --force-depends enigma2-plugin-systemplugins-icetv
I tried the last line, via telnet, and it worked. I'll try the script out when I do another USB FW update (on a non-vital T2 :lol: ).

dRdoS7

EDIT: Removed Youtube as it must be removed with Hbbtv (No package removed message).
Last edited by dRdoS7 on Mon Feb 27, 2017 15:07, edited 4 times in total.

User avatar
MrQuade
Uber Wizard
Posts: 11844
Joined: Sun Jun 24, 2007 13:40
Location: Perth

Re: Script to add & remove Plugins

Post by MrQuade » Thu Feb 23, 2017 11:23

dRdoS7 wrote: I tried the last line, via telnet, and it worked. I'll try the script out when I do another USB FW update (on a non-vital T2 :lol: ).
You could also just stick the install and remove packages each into a single command if you like. Might be lightly less problematic if there is some unexpected error.

Code: Select all

#!/bin/sh

opkg install enigma2-plugin-extensions-epgrefresh enigma2-plugin-extensions-forca enigma2-plugin-extensions-merlinmusicplayer

opkg remove --force-depends enigma2-plugin-extensions-hbbtv enigma2-plugin-extensions-inigmailreader enigma2-plugin-extensions-webcamviewer enigma2-plugin-extensions-youtube enigma2-plugin-systemplugins-icetv
 
You could also copy the content of the "switch to beta feeds" script into this as well, though that is an unnecessary step with the current 16.1 beta series.
Logitech Harmony Ultimate+Elite RCs
Beyonwiz T2/3/U4/V2, DP-S1 PVRs
Denon AVR-X3400h, LG OLED65C7T TV
QNAP TS-410 NAS, Centos File Server (Hosted under KVM)
Ubiquiti UniFi Managed LAN/WLAN, Draytek Vigor130/Asus RT-AC86U Internet
Pixel 4,5&6, iPad 3 Mobile Devices

prl
Wizard God
Posts: 32703
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: Script to add & remove Plugins

Post by prl » Thu Feb 23, 2017 11:40

dRdoS7 wrote:...
Can/should I add some sort of error checking?
There aren't really any error conditions that you'd want to test for.
dRdoS7 wrote:... How do I make sure it has run correctly, can I get, and pause a screen output?
There will be a fair bit of information printed by opkg anyway. You can feed the output of the script into a paginator, if you want to:

./plugin-installer 2>&1 | less
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

dRdoS7
Wizard
Posts: 1097
Joined: Tue Sep 22, 2015 11:47

Re: Script to add & remove Plugins

Post by dRdoS7 » Thu Feb 23, 2017 17:42

Hi,

OK, updated the "spare" T2 to 20170222, after loading saved settings, installing OverlayHD, and several Reboots, I ran the script.

Strangely it wouldn't do the installs at first run, it removed a couple of plugins, and I noticed that I'd left "ini" off webcamviewer. Fixed that and ran it again, this time it did the installs, and removed the WCV. Actually, I had to run it 3 times, I can't remember exactly why, but finally, and after an couple of GUI Reboots, it was all clear.

I'll take more careful note next time.

I was getting this message, 3rd time, after it had run, installed the 3 plugins, and then I ran it again to uninstall the one that was incorrectly written:
Deprecated version constraint '>' was used with the same meaning as '>='. Use '> >' for LATER constraint.
A message about each plugin being up to date was also shown.

dRdoS7

dRdoS7
Wizard
Posts: 1097
Joined: Tue Sep 22, 2015 11:47

Re: Script to add & remove Plugins

Post by dRdoS7 » Sat Mar 11, 2017 17:08

Hi,

Today I ran the script straight after an on line update, but before rebooting, and it worked fine. No problems encountered. Speeds things up a bit this way. I don't know why an on line update should install packages that I've previously removed.

dRdoS7

Paul_oz53
Wizard
Posts: 2789
Joined: Sat Jun 13, 2009 02:34
Location: Melbourne

Re: Script to add & remove Plugins

Post by Paul_oz53 » Sat Mar 11, 2017 21:12

Love the script idea dRdoS7.

Can you post the refined version please? It will improve the upgrade process mightily if I can plagiarize your work. :wink:

I'll want to tailor it to the plugins I add and remove of course, reflecting the different ways we use our machines.

Like you, I also query the need to retain certain plugins like gmail and WebCams in the base build. :?: Neither is of any real use nor being maintained from what I can see.

Many of us are IceTV addicts so we'll have to agree to disagree on that one.

Recently I killed both WebCams and Shoutcast. However, when I went to navigate across the vacant menu slot the machine crashed. Have you ever experienced a similar effect?

Thanks in advance,
Paul.
__________________________________
Paul
Beyonwiz T4, 2 x U4: FW - 19.3 20211010
Samsung QA85Q80BAWXXY 4K TV
Samsung QA65Q80TAWXXY 4K TV
Samsung HW Q800BXY soundbar
OverlayHD 1.70, IceTV, Foxtel IQ4
2 x Win7 PCs, 2 x Win10 PCs
Denon AVR -X2400H

dRdoS7
Wizard
Posts: 1097
Joined: Tue Sep 22, 2015 11:47

Re: Script to add & remove Plugins

Post by dRdoS7 » Sat Mar 11, 2017 21:42

Hi,

The second post has the script I'm using.

I had an idea that something should be left in sub-menu, and I leave Shoutcast, so I never had a crash. Only time was when I accidentally uninstalled the wrong plugin, which is why I wrote the script.

dRdoS7

Paul_oz53
Wizard
Posts: 2789
Joined: Sat Jun 13, 2009 02:34
Location: Melbourne

Re: Script to add & remove Plugins

Post by Paul_oz53 » Sun Mar 12, 2017 12:25

Thanks,
I assume if I save the text in a .sh text file then I can run it as a script as I do for the beta feed script.
Paul
__________________________________
Paul
Beyonwiz T4, 2 x U4: FW - 19.3 20211010
Samsung QA85Q80BAWXXY 4K TV
Samsung QA65Q80TAWXXY 4K TV
Samsung HW Q800BXY soundbar
OverlayHD 1.70, IceTV, Foxtel IQ4
2 x Win7 PCs, 2 x Win10 PCs
Denon AVR -X2400H

dRdoS7
Wizard
Posts: 1097
Joined: Tue Sep 22, 2015 11:47

Re: Script to add & remove Plugins

Post by dRdoS7 » Sun Mar 12, 2017 13:40

Hi,
Paul_oz53 wrote:Thanks,
I assume if I save the text in a .sh text file then I can run it as a script as I do for the beta feed script.
Paul
Yes.

dRdoS7

prl
Wizard God
Posts: 32703
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: Script to add & remove Plugins

Post by prl » Sun Mar 12, 2017 16:05

Paul_oz53 wrote:Thanks,
I assume if I save the text in a .sh text file then I can run it as a script as I do for the beta feed script.
Paul
It doesn't need to have a .sh extension (but it doesn't matter or do anything extra if it has the extension).

And with #!/bin/sh as the first line, if you enable its execute permission bits, you can just run it as a program, without explicitly running the shell (sh).

So if the script is in your current directory, you can just run:

./script_name

The same goes for the beta feed script.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

dRdoS7
Wizard
Posts: 1097
Joined: Tue Sep 22, 2015 11:47

Re: Script to add & remove Plugins

Post by dRdoS7 » Sun Mar 12, 2017 18:56

Hi,
prl wrote:
Paul_oz53 wrote:Thanks,
I assume if I save the text in a .sh text file then I can run it as a script as I do for the beta feed script.
Paul
It doesn't need to have a .sh extension (but it doesn't matter or do anything extra if it has the extension).

And with #!/bin/sh as the first line, if you enable its execute permission bits, you can just run it as a program, without explicitly running the shell (sh).

So if the script is in your current directory, you can just run:

./script_name

The same goes for the beta feed script.
It makes it easier to open/edit in Windows if it has an extension. Otherwise I have to right-click and select an option, or if I left-click I have to select a program. It's not possible to set a default program without an extension.

I just used the .sh 'cause that was how the switch script was.

dRdoS7

Paul_oz53
Wizard
Posts: 2789
Joined: Sat Jun 13, 2009 02:34
Location: Melbourne

Re: Script to add & remove Plugins

Post by Paul_oz53 » Sun Mar 12, 2017 19:14

Not being a Linux person I need to keep it simple too. :mrgreen: But I appreciate the education!
__________________________________
Paul
Beyonwiz T4, 2 x U4: FW - 19.3 20211010
Samsung QA85Q80BAWXXY 4K TV
Samsung QA65Q80TAWXXY 4K TV
Samsung HW Q800BXY soundbar
OverlayHD 1.70, IceTV, Foxtel IQ4
2 x Win7 PCs, 2 x Win10 PCs
Denon AVR -X2400H

Post Reply

Return to “Plugins”