[Plugin] CA User Scripts


Recommended Posts

Is it possible to run a script as the CA User Scripts user/program?

I want to setup PlexDrive through it, but it requires a one time input from the user (client id stuff and then a dynamically generated code which I have to enter)

 

More info:

I used wget to download the linux-amd64 release of PlexDrive 5.0.0, and in the terminal executed the PlexDrive with parameters to test if my commands were gonna work. They did.

Now apperently setting up (running the same commands) PlexDrive through CA User Scripts requires me to log in again, as Google sees it as a different "app".

 

Edit:

In short, which user is the CA User Scripts user?

 

Edit 2:

Odd, when I run id -un through CA User Scripts, it shows root.
Seems like I need to somehow bash into CA User Scripts or something like that.

Edited by Arndroid
Link to comment
2 hours ago, trurl said:

 

Basically everything in unRAID runs as root. The other "users" are only for network access to shared folders with SMB, NFS, AFP.

Hmm, alright. But then why does PlexDrive require a different Google OAuth?

Is it because it runs from a bash script though CA User Scripts or something?

 

Edit:

I think I figure out why... My bad.

Edited by Arndroid
Link to comment

Does anyone have any tips on the correct syntax in order to do that? I would google it, but i thought there might be something specific or something already tailored for unraid. 

ie the correct syntax for "if X is still running, wait until finished, then start Y"

 

 

Link to comment
5 hours ago, DZMM said:

is it possible to run python scripts?  I'm trying to run this script https://gist.github.com/JonnyWong16/2607abf0e3431b6f133861bbe1bb694e which starts with:

 


#!/usr/bin/env python

Thanks

Do not forget that python is not included in the standard unRAID distribution.     You would therefore have to install python (typically done via the Nerd Pack plugin) to be able to run the script.

Link to comment

Looking for some advice on a script I've added (which i believe runs successfully) as unsure where the parsing issue is. 

 

Seeing a lot of the below in syslog:

Aug 23 16:48:01 Tower crond[1440]: failed parsing crontab for user root: /usr/local/emhttp/plugins/user.scripts/startCustom.php /boot/config/plugins/user.scripts/scripts/copy_pibackup_to_Backup_share/script > /dev/null 2>&1

This is the script:

#!/bin/bash
/usr/bin/rsync -aPX /mnt/cache/pibackup.img /mnt/user/Backup/

Name of user script, description and custom cron:

Capture.thumb.JPG.37ccc950b3adfeaa128d32f6c220df8e.JPG

 

cheers

Link to comment
30 minutes ago, sketchy said:

Looking for some advice on a script I've added (which i believe runs successfully) as unsure where the parsing issue is. 

 

Seeing a lot of the below in syslog:


Aug 23 16:48:01 Tower crond[1440]: failed parsing crontab for user root: /usr/local/emhttp/plugins/user.scripts/startCustom.php /boot/config/plugins/user.scripts/scripts/copy_pibackup_to_Backup_share/script > /dev/null 2>&1

This is the script:


#!/bin/bash
/usr/bin/rsync -aPX /mnt/cache/pibackup.img /mnt/user/Backup/

Name of user script, description and custom cron:

Capture.thumb.JPG.37ccc950b3adfeaa128d32f6c220df8e.JPG

 

cheers

Isn’t the custom field at the end meant to have 5 values rather than 4?

Link to comment
1 hour ago, itimpi said:

Isn’t the custom field at the end meant to have 5 values rather than 4?

 

Aha, good spot @itimpi. That may be what the parsing error was complaining about. I'll put another asterisk on the end for the 'day of week' requirement, see how it likes that!

 

Edit: Looks like that cleared the issue. Cheers @itimpi

Edited by sketchy
In post
Link to comment

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.