Collapse AllExpand All

8.2.1. OSX Shell Script

Copy and save the shell script below in your xTuple Connect Batch Manager admin user's home directory as startbm.command. This is the shell script that will be launched when the admin user is automatically logged in.

Note

You will need to edit the first six parameters to match your environment.

#!/bin/bash
# Autostart of BatchManager for OSX
# Name this file 'startbm.command' and should be located under your users home directory
# To start the BatchManager in OSX upon Login, create a Login Item for a user that will
# login upon system startup.
# Navigate to System -> Accounts -> Login Items, and add 'startbm.command' to the list.

###################################################
## EDIT NEXT SIX LINES TO MATCH YOUR ENVIRONMENT ##
###################################################

BM_PATH='/Applications/BatchManager.app/Contents/MacOS/'
DB_SERVER='192.168.0.100'
DB_NAME='mydemodb'
DB_PORT='5432'
DB_USERNAME='myuser'
DB_PASSWD='mypassword'

#################################
## DO NOT EDIT BELOW THIS LINE ##
#################################

DB_URL=psql://$DB_SERVER/$DB_NAME:$DB_PORT
$BM_PATH/BatchManager -databaseURL=$DB_URL -username=$DB_USERNAME -passwd=$DB_PASSWD &
exit
8.2.1.1. Setting Up User for Auto Login

Once the shell script has been modified and saved to the correct location, your next step is to attach the script to the admin user's login items. To attach the script to the admin user's login items, follow these steps:

  1. Select the "System Preferences" icon

  2. Select the "Accounts" option under the System section

  3. Then, set up the user for automatic login, as shown in the following screen:

Set Up User for Automatic Log In

Finally, follow these last steps:

  1. Highlight the user in the "My Account" column

  2. Select the "Login Items" tab

  3. Select the "+" symbol

  4. Then browse to locate and then add the startbm.command file from the user's home directory

  5. The following screen illustrates this process:

Link Shell Script to User

Once you have completed these steps, you are done! The xTuple Connect Batch Manager will now restart automatically whenever the machine it is running on is rebooted.