Hi I’m looking at writing a script with the parameters for Teams Classic.
Condition
do i have Teams Clssic.app and is it running
if i have Teams Classic.app and its not running
delete it
if i have Teams Classic.app and its running
stop app
then delete it
So far I have the following code written out, but can’t see how I can use this if statement to meet all my condition
if [ -d "/Applications/Microsoft Teams classic.app" ] || [ -d "/Applications/Microsoft Teams.app" ] && [ (ps aux | grep Microsoft Teams Classic.app | grep -v grep > /dev/null) ] then
echo RUNNING
killall "Microsoft Teams Classic.app"
rm -rf /Applications/Microsoft Teams Classic.app
rm -rf ~/Library/Preferences/com.microsoft.teamsclassic.plist
rm -rf ~/Library/Caches/com.microsoft.teamsclassic
rm -rf ~/Library/Logs/com.microsoft.teamsclassic
else
echo STOPPED
fi