Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

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.

Shell script invalid command

Featured Replies

Please help me with this (small) problem. New to doing shell scripts so sure it's something small

Created a shell script and saved it (myfile.sh) in scripts folder. Fixed r/w privileges to fmserver.

One line only in myfile.sh: curl http://123.123.123.123/myfolder/sendemail.php

FMS returns a invalid command error.

If I run it in Terminal it works fine.

What am I missing?

Thanks,

Marco

Is that 123.123. server the same box or a different one? What does the php page do?

Did you also fix the execute privileges?

  • Author

Fixed the execute but still same error...

2011-02-07 08:11:31.114 +0100 Error 154 BLOOM FMS 10 Schedule "Newsletter Shellscript" aborted; "sendnewsletter.sh" could not be found or is invalid.

The php sends emails to selected addresses.

Don't understand what you're saying if the server is same box..

Thanks for your help.

2011-02-07 08:11:31.114 +0100 Error 154 BLOOM FMS 10 Schedule "Newsletter Shellscript" aborted; "sendnewsletter.sh" could not be found or is invalid.

Don't understand what you're saying if the server is same box..

The curl command in your shell script targets an IP address. And since your example didn't use "localhost" or "127.0.0.1" I was asking if the PHP file is on the same box as FMS or on a different box. If it's on a different box, it could be an access privileges issue. The "fmserver" account that drives FMS may not have permissions to touch that file on the remote machine whereas your account does. Which would explain why it runs while you are logged in but not when FMS executes it.

"sendnewsletter.sh" could not be found or is invalid.

This does look however like the permissions on the shell script itself are not correct. Set "fmserver" as the owner, "fmsadmin" as the group.

  • Author

@ Wim

File is on same machine. Changed ip to localhost. No change.

Also changed the shell command no nothing. Same error.

I'm sure you're right it has to do with ownership. Changed it to fmserver and fmsadmin. No change. Cant adjust privileges now (-142 chmod failure). What does that indicate?

I work in Coda. If I create new file in script folder it has no ownership or privileges. I can't adjust ownership. I can adjust privileges.

How do I create a 'fresh' file? So that I'm sure all settings are correct?

Thanks for your help!

Don't know Coda, but just create a new blank text file using text edit and copy/paste the shell script code into that new file. Change the extension to .sh, use Batchmod to set the ownership and group plus the rwx privileges and try to run it manually. If that works, move it into the FMS scripts folder and try with a schedule.

  • Author

Done exactly what you said. It runs in terminal but not as a schedule in FMS10

Now what?

Are you still getting the "script not found" error or another error?

  • Author

Still the same: Error 154 BLOOM FMS 10 Schedule "Newsletter Shellscript" aborted; "sendnewsletter.sh" could not be found or is invalid.

The PHP file sends emails to selected addresses. Could that be the problem?

I doubt it. It sounds more like FMS has trouble executing the file.

But to make sure: can you replace the shell script (use the same name though) with one that just creates a little text file in the FMS documents folder (FMS has rights to that). That way we would know if the file actually executes. If it does, then it is the code in the shell script that doesn't work.

  • 2 weeks later...

we solved this particular user's problem over on FileMaker TechNet by adding a proper hashbang (first line of script: "#!/bin/sh") to the script file

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

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.