Skip to content
View in the app

A better way to browse. Learn more.

Learn more

Terminal shell script close file daemon

Featured Replies

I need to AppleScript the closing of served files when the power fails. My power supply can trigger an AppleScript which can call a Terminal shell script that can close the files, to allow an elegant shut down when needed. I can do all but the last step, I have no UNIX training and wonder if anyone else has done this to help me along.

  • 4 weeks later...
  • Newbies

#!/bin/sh

/usr/bin/fmsadmin stop

the above run as a shell script will shutdown the databases (giving clients 30 seconds to disconnect, by default) and stop the server.

if you need other options (messages to clients, more/less time before disconnect, etc.) type

fmsadmin HELP stop

at the command line on your server.

just put the two lines at the top in a text editor (make sure it's text only, not RTF or something), such as vi or BBEdit. call it somethign like shutdown.sh, then, at the command line, do:

chmod +x shutdown.sh

to make it executable

if you need to make it a double-clickable type file (I'm not sure how applescript works and what it needs), call it shutdown.command, then do a command-i (get info) on the file, check hide extension if you want, and change Open with: to Terminal.

-rich

Create an account or sign in to comment

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.