2017-05-23 15:51:19 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
## Create file path variables ##
|
|
|
|
tempFilePath='/tmp/sym_settings.txt'
|
|
|
|
installPath="$2"
|
|
|
|
configPath="/Symphony.app/Contents/config/Symphony.config"
|
2017-11-07 01:53:31 -06:00
|
|
|
newPath=${installPath}${configPath}
|
|
|
|
|
2017-05-23 15:51:19 -05:00
|
|
|
## Get Symphony Settings from the temp file ##
|
2017-11-07 01:53:31 -06:00
|
|
|
pod_url=$(sed -n '1p' ${tempFilePath});
|
2017-05-23 15:51:19 -05:00
|
|
|
minimize_on_close=$(sed -n '2p' '/tmp/sym_settings.txt');
|
|
|
|
launch_on_startup=$(sed -n '3p' '/tmp/sym_settings.txt');
|
2017-06-16 11:23:35 -05:00
|
|
|
always_on_top=$(sed -n '4p' '/tmp/sym_settings.txt');
|
2018-01-05 06:12:43 -06:00
|
|
|
bring_to_front=$(sed -n '5p' '/tmp/sym_settings.txt');
|
2017-05-23 15:51:19 -05:00
|
|
|
|
2017-11-29 02:36:34 -06:00
|
|
|
if [ "$pod_url" == "" ]; then
|
|
|
|
pod_url="https://corporate.symphony.com"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$minimize_on_close" == "" ]; then
|
|
|
|
minimize_on_close=true;
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$launch_on_startup" == "" ]; then
|
|
|
|
launch_on_startup=true;
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$always_on_top" == "" ]; then
|
|
|
|
always_on_top=false;
|
|
|
|
fi
|
|
|
|
|
2018-01-05 06:12:43 -06:00
|
|
|
if [ "$bring_to_front" == "" ]; then
|
|
|
|
bring_to_front=false;
|
|
|
|
fi
|
|
|
|
|
2017-05-23 15:51:19 -05:00
|
|
|
## Replace the default settings with the user selected settings ##
|
2017-11-07 01:53:31 -06:00
|
|
|
sed -i "" -E "s#\"url\" ?: ?\".*\"#\"url\"\: \"$pod_url\"#g" ${newPath}
|
|
|
|
sed -i "" -E "s#\"minimizeOnClose\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"minimizeOnClose\":\ $minimize_on_close#g" ${newPath}
|
|
|
|
sed -i "" -E "s#\"alwaysOnTop\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"alwaysOnTop\":\ $always_on_top#g" ${newPath}
|
|
|
|
sed -i "" -E "s#\"launchOnStartup\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"launchOnStartup\":\ $launch_on_startup#g" ${newPath}
|
2018-01-05 06:12:43 -06:00
|
|
|
sed -i "" -E "s#\"bringToFront\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"bringToFront\":\ $bring_to_front#g" ${newPath}
|
2017-05-23 15:51:19 -05:00
|
|
|
|
|
|
|
## Remove the temp settings file created ##
|
2017-11-07 01:53:31 -06:00
|
|
|
rm -f ${tempFilePath}
|
2017-06-25 03:29:31 -05:00
|
|
|
|
|
|
|
## For launching symphony with sandbox enabled, create a shell script that is used as the launch point for the app
|
2017-11-07 01:53:31 -06:00
|
|
|
EXEC_PATH=${installPath}/Symphony.app/Contents/MacOS
|
|
|
|
exec ${EXEC_PATH}/Symphony --install ${newPath} ${launch_on_startup}
|
|
|
|
chmod 755 ${EXEC_PATH}/Symphony
|