diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2020-12-11 17:00:31 +0000 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2020-12-11 17:00:31 +0000 |
commit | bbbc1f3a751338ea5371b25da36ccff3255ba138 (patch) | |
tree | 9e74ea860ec360e02258139270ecca6c3cacf0f1 /remind.sh | |
parent | a76bf14d21e3bd583324d26ea5ca7e3360151707 (diff) |
better warnings regarding remind process
Diffstat (limited to 'remind.sh')
-rwxr-xr-x | remind.sh | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -32,7 +32,6 @@ else DATETIME="$2" DESCRIPTION="$3" fi -echo "$TARGETFILE" # Guard against bad file names if [[ "$TARGETFILE" != "home" && "$TARGETFILE" != "work" ]] ; then echo -e "${red}Please provide either 'work' or 'home' as the first argument.$eescape" @@ -84,8 +83,13 @@ fi COMMAND="REM $day ${MONTHS[$month]} $year AT $TIME +15 *5 MSG $DESCRIPTION %1" # main +# COMMENT THIS OUT WHEN TESTING ON LOCAL VM +# -------------- +pid_cmd="pgrep remind" +remind_command_msg="${brightyellow}Run '$remind_full' in a tmux window on $TW_HOOK_REMIND_REMOTE_HOST.$eescape" # first test if pid - if not exit (SCRIPT OBVIOUSLY WILL NOT PROCEED FOR TEST SERVER) -[[ -z $(ssh $TW_HOOK_REMIND_REMOTE_HOST "$pid_cmd > /dev/null 2>&1") ]] && echo "Failed to get remind PID" && exit 1 +[[ -z $(ssh $TW_HOOK_REMIND_REMOTE_HOST "$pid_cmd") ]] && echo -e "${red}Failed to get remind PID. remind is not running.$eescape" && echo -e $remind_command_msg && exit 1 +# ------------- ssh $TW_HOOK_REMIND_REMOTE_HOST " echo "$COMMAND" >> ~/.reminders/${TARGETFILE}.rem |