As far as I understand it {ARGUMENTS} {ROOM} {USER} are placeholders that are filled with the user given input, the user id and the room id, but installing the script needs exactly these term so that the script can be successful run.
Nevertheless I got the same problem - I always and up with “script is invalid”, even the demo script calc.sh causes this error message. And sadly no one answers this question, I found some more who asked for hints what to do without evenb a response…
So using literally those should work. Please note that {ARGUMENTS_DOUBLEQUOTE_ESCAPED} has been removed and will make your script not execute when being used.
It seems there is a permission/user mismatch between the script and the execution. The script should be owned by your webservers user (for me www-data) and it must be executable for them:
ls -la sample-commands/
-rwxrw-r-- 1 www-data www-data 664 Mai 8 08:51 calc.sh
drwxrwxrwx 2 christoph psacln 4096 Sep 14 20:50 .
drwx–x— 17 christoph psaserv 4096 Sep 14 20:57 …
-rwxrw-r-- 1 christoph psacln 430 Sep 6 21:09 calc.sh
-rwxrw-r-- 1 christoph psacln 4321 Sep 6 21:09 dice.php
-rwxrw-r-- 1 christoph psacln 545 Sep 6 21:09 talktest.php
-rwxrwxrwx 1 christoph psacln 301 Sep 6 21:09 testausgabe.php
When trying to add the command occweb tells me Script ist invalid, tryin the same with Putty from within my nextcloud folder I get “./occ persission denied”. In putty I’m logged in as root. christoph is my username wehn I installed nextcloud and seems to be the webuser, right? dont know what psacln is (group?).
If I would have to log into Putty as christoph I don’t know the password (and the same as my password for my Nextcloud account on that instance doesn’t work).
So what’s still wrong with that? Wounld be very thankful for some hints as I’m not the LInux guy…
sudo -u abc php /config/www/nextcloud/occ talk:command:add test test "/data/myname/scripts/test.sh {ARGUMENTS} {ROOM} {USER}" 1 3
If you do not need to know about room and/or user, simply remove it from the path.
Those parameters will be forwarded to your script, but you do not need to set them. E.g. everybody who will call your script will send they name to the field user. I wrote few scripts also, you can check and test them before to added own.
Check this explanation
Simply check in your installation path to whom belongs your nextcloud, e.g.:
A big thank you! I was struggling with that for months now (okay, first with a Nextcloud on hosted Webspace, on V-Server now just for a week), but finally I was able to install the scripts right now via occweb. I think my problem last night after changing the rights and non-working scripts resulted on server upgrades that my provider ran yesterday, I forgot about that.
Now my own scripts work, but the calc script doesn’t (command not found), but I font really need that and guess this happens cause it’s just a call for gnu calc and I don’t now if that’s installed…).
Last question: If I need to change thing in the command script do I need to use talk:command:Update or can I just edit the script file as long as the path doesn’t change?