This paste expires on 2023-05-23 20:49:50.654937. Repaste, or download this paste. . Pasted through web.

shopt -s extdebug
checkcommand() {
  if [[ $BASH_COMMAND = 'mv'*' /'*' '* ]]; then
    echo "WARNING - DESTRUCTIVE COMMAND: suppressing mv command with root directory combined with wildcard" >&2
    return 1
  elif [[ $BASH_COMMAND = 'rm -rf /'* ]]; then
    echo "WARNING - DESTRUCTIVE COMMAND: suppressing rm -rf command with root directory" >&2
    return 1
  fi
}
trap checkcommand DEBUG
Filename: None. Size: 405b. View raw, , hex, or download this file.