Simple Bash +1 please
Hey there. I know I'm missing something simple in this script. But what is it? an exit? fi? When I use Name -online i get the echo "Bool Changed offline2" from the very last section. Online code shouldnt clash with Offline. Help, I've been at this for hours.
if [ "$1" == "-online" ]; then
if [ "$Check" == "com.company.package1" ]; then
plutil -key settingsOfflineMode -value 0 -type bool /the/dir/ect/ory/com.company.package1 &> /dev/null
echo "Bool Changed online1"
exit
fi
else
if [ "$Check" == "com.company.package2" ]; then
plutil -key settingsOfflineMode -value 0 -type bool /the/dir/ect/ory/com.company.package2 &> /dev/null ////EDITED TO com.company.package2
echo "Bool Changed online2"
exit
fi
fi
if [ "$1" == "-offline" ]; then
if [ "$Check" == "com.company.package1" ]; then
plutil -key settingsOfflineMode -value 0 -type bool /the/dir/ect/ory/com.company.package1 &> /dev/null
echo "Bool Changed offline1"
exit
fi
else
if [ "$Check" == "com.company.package2" ]; then
plutil -key settingsOfflineMode -value 0 -type bool /the/dir/ect/ory/com.company.package2 &> /dev/null //EDITED TO com.company.package2
echo "Bool Changed offline2"
exit
fi
fi