Bash script error - .plist file

rael
New Contributor II

Hello.

I was trying to deploy an app called bridgechecker, which only purpose is to disable the wifi automatically when an ethernet cable was plugged in.

So far I was able to get the pkg file deployed on the test device, but unfortunately the bash script which was sent to me by the support team of this app is either broken or I'm doing it wrong.

This bash script will run after the deployment and it is used to overwrite the contents of a .plist-file.
I've attached the error log from jamf as an attachment.

de1508e3612f4c3ebd89daf90db7dad6

This is the bash script I was using:

#!/bin/bash
clear
echo "**** Updating defaults for BridgeChecker ******"

#for first three valid values are 0 or 1
releaseIP=1
loadOnStartUp=1
enableWireless=1
#anything you want
EXIT_PASSWORD=1234
#valid values are 0, 1 or 2
selectedInterfaceOption=1

defaults write com.accessagility.bridgechecker '{ "releaseIP" = '"$releaseIP"';
                                  "loadOnStartUp" = '"$loadOnStartUp"';
                                  "enableWireless" = '"$enableWireless"';
                                  "EXIT_PASSWORD" = '"$EXIT_PASSWORD"';
                                 "selectedInterfaceOption" = '"$selectedInterfaceOption"';}';

echo "**** Updated defaults successfully ******"         
echo "**** Updated defaults are ******"

defaults read com.accessagility.bridgechecker

Is there maybe an easier way to do this ?
Thank you for your feedback.

1 ACCEPTED SOLUTION

rael
New Contributor II

I now know where the problem lies. The app has to run after deployment and the macbook needs to be restarted to successfully create the needed plist-file which we want to edit.
This was not mentioned in the deployment guide.

Anyway, thank you for your help!

View solution in original post

4 REPLIES 4

tlarkin
Honored Contributor

If you set the service order of your Macs to have Ethernet be a priority, you can have both WiFi and Ethernet active, it doesn't hurt anything. macOS is smart enough to only use the primary adapter for all network connectivity. So, there should be no need to do this.

rael
New Contributor II

Thanks for the reply. I know that this is possible and we're already set it in this order.
But we want to achieve a release of the ip address when the macbook switches over from wifi to ethernet connection.

tlarkin
Honored Contributor

gotcha, well the error message it saying the file doesn't exist. Try downloading something like Suspicious Package and inspect the package you have built and ensure that the plist file is in fact included in the package payloads.

If not, you will have to create it

rael
New Contributor II

I now know where the problem lies. The app has to run after deployment and the macbook needs to be restarted to successfully create the needed plist-file which we want to edit.
This was not mentioned in the deployment guide.

Anyway, thank you for your help!