Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Plugin] CA User Scripts

Featured Replies

@Squid

 

Would be nice to have some code or maybe a built in function of the Plugin to backup/restore all scripts. I've massed several of them and well it would really be disappointing if I messed up and lost them all. Maybe part of the Backup/Restore Plugin we all love. 😀Yes I know they are originally saved on the Flash Drive, but you always do things so much more Elegant. 

 

Just in case your board and have nothing else to work on. Lol

  • Replies 2.1k
  • Views 567.1k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • I could make up something long, convoluted, and technical as a reason why it doesn't do that but it would all be bs.  The simple answer is that when I did this, I never thought of that, and why it sti

  • Hi All - We have a fix and are publishing a Connect plugin update to fix it today. Thanks for letting us know.

  • @Squid I tried many commands and by that I found out that pkill does not kill (all) child processes: root@Thoth:/tmp# pgrep -f isleep2m | xargs --no-run-if-empty ps fp PID TTY STAT T

Posted Images

  • Author
11 minutes ago, kizer said:

Maybe part of the Backup/Restore Plugin we all love.

Technically it already does via the USB backup part.

Just now, Squid said:

Technically it already does via the USB backup part.

 

Ok now I feel kinda dumb. Lol

I'm at sick at home with a Fever playing on unraid.net lol 

 

I think I should go back to bed. Thanks @Squid for all the awesome stuff you do. 

  • Author
On 2/23/2019 at 8:16 PM, Cessquill said:

There may be a valid reason why this is not done already, but if you edit the name of the script, could it also update the name of the corresponding folder in the user.scripts\scripts directory?

I could make up something long, convoluted, and technical as a reason why it doesn't do that but it would all be bs.  The simple answer is that when I did this, I never thought of that, and why it still doesn't do it is pure laziness

12 hours ago, Squid said:

I could make up something long, convoluted, and technical as a reason why it doesn't do that but it would all be bs.  The simple answer is that when I did this, I never thought of that, and why it still doesn't do it is pure laziness

That's the spirit!

 

Some of my projects at work have more comment than code.

I have a Daily DVR Section on my plex server.  It records the OTA Daily TV shows but they way plex is setup it keeps shows until its watched and then deleted.  

I don't know how to script but looking for someone to create a script.  I want this to run at midnight and I wanted to delete all video files older than 24hours or have it flagged as watched and plex will delete automatically. 

I'm having a strange issue. All my schedules somehow got set to disabled and when i try to re-enable the schedule, i can't press "Apply". Nothing happens. If i go back to the page, it's all disabled again. I've tried different browsers and have rebooted several times (for other reasons) and it's still not working. The scripts work fine if run manually. I've tried removing and re-adding the user scripts plugin, didn't help.

  • Author
I'm having a strange issue. All my schedules somehow got set to disabled and when i try to re-enable the schedule, i can't press "Apply". Nothing happens. If i go back to the page, it's all disabled again. I've tried different browsers and have rebooted several times (for other reasons) and it's still not working. The scripts work fine if run manually. I've tried removing and re-adding the user scripts plugin, didn't help.
Post your diagnostics

Sent via telekinesis

My script file is a python script, but it keeps failing because python decides to use ANSII instead of UTF-8. It turns out that the LANG environment variable is not being set to en_US.UTF-8. Any ideas how I could fix that without having a boiler plate shell script?

Edited by UntouchedWagons

  • Author
2 hours ago, UntouchedWagons said:

My script file is a python script, but it keeps failing because python decides to use ANSII instead of UTF-8. It turns out that the LANG environment variable is not being set to en_US.UTF-8. Any ideas how I could fix that without having a boiler plate shell script?

https://forums.unraid.net/topic/48286-plugin-ca-user-scripts/?page=25&tab=comments#comment-720270

 

1 hour ago, Squid said:

What is the output of


ls -ail /boot/config/plugins/user.scripts/scripts/

 

4041 drwxrwxrwx 14 root root 8192 Mar 12 16:24 ./
4039 drwxrwxrwx  3 root root 8192 Jan 16 05:43 ../
5133 drwxrwxrwx  2 root root 8192 Nov 18 18:57 USB\ HotPlug/
5105 drwxrwxrwx  2 root root 8192 Nov 18 18:57 apcupsd?.sh/
5109 drwxrwxrwx  2 root root 8192 Nov 18 18:57 clear\ an\ array\ drive/
5115 drwxrwxrwx  2 root root 8192 Nov 18 18:57 delete.ds_store/
5112 drwxrwxrwx  2 root root 8192 Nov 18 18:57 delete_dangling_images/
5118 drwxrwxrwx  2 root root 8192 Mar  1 23:23 duplicacy\ install/
5124 drwxrwxrwx  2 root root 8192 Nov 18 18:57 icon\ sync/
5121 drwxrwxrwx  2 root root 8192 Nov 18 18:57 icon_banner\ downloader/
5127 drwxrwxrwx  2 root root 8192 Nov 18 18:57 move\ array\ only\ shares/
5130 drwxrwxrwx  2 root root 8192 Nov 18 18:57 move\ cache\ only\ shares/
5135 drwxrwxrwx  2 root root 8192 Nov 18 18:57 viewDockerLogSize/
5138 drwxrwxrwx  2 root root 8192 Nov 18 18:57 vm\ settings\ backup/

 

  • Author
4 minutes ago, Kewjoe said:

5105 drwxrwxrwx 2 root root 8192 Nov 18 18:57 apcupsd?.sh/

I think that's messing it up  Rename or move elsewhere

31 minutes ago, Squid said:

I think that's messing it up  Rename or move elsewhere

Nice. that worked. Not sure how that happened. Isn't apcupsd one of the default scripts you include? i might have added it myself a long time ago. Ah well. works now. Thanks!

  • Author
7 minutes ago, Kewjoe said:

Isn't apcupsd one of the default scripts you include?

nope

Want to use CA to download a gz file, extract it to TVheadend and change name. I try this Linux command but it fail:

The first string execute this error:

wget webblink /mnt/user/appdata/tvheadend/data/: Scheme missing.

 

Edited by stormense
exam

Feeling like a huge idiot! I have 2 unraid servers. One on 6.6.6 one on 6.3.5. I found and installed User Scripts in the 6.6.6 but when I search CA for "User Scripts" in the 6.3.5 machine I get "No Matching Content Found" but if I search just "User" I get 21 results none of which are the right one. What gives?

 

I did manage to install it manually using the URL, someone tell me this is either very weird or very common.

Edited by Adriano90
Solved...kinda

  • Author
21 minutes ago, Adriano90 said:

6.3.5.

Since your server is 6.3.5, you are running a very old version of CA which is using an outdated and unreliable application feed that doesn't even have 1/10th of the apps available.  CA has required 6.4+ for quite a while now and the URLs for the feed changed a long time ago.  Update your server and CA

Ops, find this in other forum an if I download a file and save it in a specific directory the directory is first with the -P flag.

 

wget -P /mnt/user/appdata/tvheadend/data/ webblink/epg/guide-sweden.xml.gz

Edited by stormense
solved the problem

26 minutes ago, Squid said:

Since your server is 6.3.5, you are running a very old version of CA which is using an outdated and unreliable application feed that doesn't even have 1/10th of the apps available.  CA has required 6.4+ for quite a while now and the URLs for the feed changed a long time ago.  Update your server and CA

Was planning on updating after a backup which I was trying to use the script to do (JUST IN CASE). Thanks for the help!

OK, so back again. I am trying to use the 'clear array drive' script in order to shrink my array. I added a drive to the array earlier today and shortly realized that another drive was acting up. I am in the process of trying to remove the newly added drive by the clear drive and then redeploy it for the dodgy drive to be rebuilt.

 

When I run the script, it finishes instantly and the folder 'clear-me' still remains on the drive in question. This drive was only added to the array and formatted (to do so) so does not have any data on it. I don't see any pesky hidden files, so I am wondering how to get it to zero the drive?

19 minutes ago, johnnie.black said:

I believe the script isn't working very well with current Unraid, if you want to do that and are semi-comfortable with the console you can do it manually:

 

https://forums.lime-technology.com/topic/61614-shrink-array-question/?tab=comments#comment-606335

Thanks again Johnnie.

 

Just to be extra clear (paranoid) the UnRAID managed device number should always be the same as the disk number, correct? So if I need to zero disk 16, I would use md16. Sorry for the cluelessness.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.