From 0e716fb43a7966b9456d5b3805b3c44e48daf8a0 Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Tue, 12 Nov 2024 10:31:58 -0500 Subject: [PATCH] Remove the need for sudo mtr on macos --- configs/.zshrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configs/.zshrc b/configs/.zshrc index d4b2636..5397d60 100644 --- a/configs/.zshrc +++ b/configs/.zshrc @@ -112,6 +112,9 @@ alias genuuid="python -c 'import uuid; print(uuid.uuid4())'" alias nvim-tmp="$EDITOR $(mktemp)" alias vim-tmp="$EDITOR $(mktemp)" +# If this is macos, alias `mtr` to `sudo mtr` (if mtr exists) +[[ $(uname -s) == "Darwin" ]] && [[ -x "$(command -v mtr)" ]] && alias mtr="sudo mtr" + # Some aliases only make sense if their parent command exists [[ -x "$(command -v wg)" ]] && alias wg-easykeys="wg genkey | tee >(wg pubkey)" [[ -x "$(command -v systemd-resolve)" ]] && alias flush-dns="sudo systemd-resolve --flush-caches"