Skip to content

Instantly share code, notes, and snippets.

@at1as
Created December 5, 2016 05:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save at1as/33f9938f2ecea8220003ecb0501442fb to your computer and use it in GitHub Desktop.
Save at1as/33f9938f2ecea8220003ecb0501442fb to your computer and use it in GitHub Desktop.
Kill FaceTime app after X seconds
#!/bin/bash
# Usage : ./facetime_kill.sh 10
# Accepts 1 argument : a number of seconds before stopping app
if [[ $1 ]]
then
echo "Killing Facetime in ${1} seconds"
i=$1
while [[ $i -ge 1 ]]
do
echo "...${i}"
((i = i - 1))
sleep 1
done
echo "Byebye!"
kill $(ps -ef | grep -i "/Applications/FaceTime.app" | grep -v grep | head -n 1 | awk '{ print $2 }')
else
echo "Killing FaceTime in 60 seconds"
sleep 60 ; kill $(ps -ef | grep -i "/Applications/FaceTime.app" | grep -v grep | head -n 1 | awk '{ print $2 }')
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment