back

sayLater.sh

function envFile() {
  if [[ $SHELL =~ "zsh" ]]; then
    echo "${HOME}/.zshrc"
  else
    echo "${HOME}/.bashrc"
  fi
}

function isLinux() {
  uname -s | grep -i "linux" > /dev/null
}

function isMac() {
  uname -s | grep -i "darwin" > /dev/null
}

echo "
# You've been pranked by a friend or coworker!
#
# It seems you left a computer logged-in and unattended, and
# someone decided to teach you a lesson in Operational
# Security!
#
# See https://pwn.devetry.com for more information
# ----- Beginning of modifications -----" >> $(envFile)


w=cranberry

isMac && echo "(nohup bash -c \"sleep 400 && osascript -e 'set Volume 5' && say ${w}\" 2> /dev/null &)" >> $(envFile)
isLinux && echo "(nohup bash -c \"sleep 400 && amixer sset Master 50% && espeak ${w}\" 2> /dev/null &)" >> $(envFile)