Skip to main content
Solved

Bash script error - .plist file


Forum|alt.badge.img+5

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.

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.

Best answer by rael

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 original
Did this topic help you find an answer to your question?

Forum|alt.badge.img+31
  • Honored Contributor
  • August 13, 2019

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.


Forum|alt.badge.img+5
  • New Contributor
  • August 13, 2019

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.


Forum|alt.badge.img+31
  • Honored Contributor
  • August 13, 2019

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


Forum|alt.badge.img+5
  • New Contributor
  • August 16, 2019

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!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings