Commit fb76acd9 authored by nimrod's avatar nimrod
Browse files

Allow running the monitor shell function with sudo.

parent 34cb23e5
Loading
Loading
Loading
Loading
+1 −10
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ alias gen-mac="hexdump -n5 -e '\"02\" 5/1 \":%02X\" \"\\n\"' /dev/urandom"
alias clean-swp="find \$HOME/ -name '*.swp' -delete"
alias unssh="ssh -o \"UserKnownHostsFile /dev/null\" -o \"StrictHostKeyChecking no\""
alias todo="vim \$HOME/Documents/TODO.yml"
alias sudo="sudo "
alias sudo="sudo --preserve-env=PATH"
alias git="git "
alias xargs="xargs "
alias presentation='docker dev adarnimrod/presentation'
@@ -130,15 +130,6 @@ for line in stdin.readlines():
    fi
}

monitor () {
    if eval "$@"
    then
        notify-send "${1#__} has finished."
    else
        notify-send --urgency=critical "${1#__} has failed."
    fi
}

# shellcheck disable=SC2120
json_tool () {
    if [ -t 0 ]

Documents/bin/monitor

0 → 100755
+9 −0
Original line number Diff line number Diff line
#!/bin/sh
set -eu
[ "$#" -eq "0" ] || exit 0
if eval "$@"
then
    notify-send "${1#__} has finished."
else
    notify-send --urgency=critical "${1#__} has failed."
fi