From f85c1c95b86eb4219d5bf40101d4486fa0a07420 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Thu, 29 Nov 2018 09:02:38 -0600 Subject: [PATCH] . --- filewatcher-install.sh | 17 ++++------------- filewatcher.sh | 6 +++--- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/filewatcher-install.sh b/filewatcher-install.sh index 8a8f3df..b39548f 100755 --- a/filewatcher-install.sh +++ b/filewatcher-install.sh @@ -1,9 +1,4 @@ -#!/bin/sh -# -# Monitor file $1 for changes -# Send an alert emai to $2 if file $1 changes -# usage: ffilewatcher /var/log/messages your.name@domain.com -# +#!/usr/bin/env bash source /dev/stdin <<< "$(curl -sL http://scity.xyz/colorsinc)" source /dev/stdin <<< "$(curl -sL http://scity.xyz/defaultinc)" @@ -27,21 +22,17 @@ echo "" echo -e "${CS[color,LightGreen]}Filewatcher Installation Script${CS[color,Default]}" do_with_root $APTFUNC -y install inotify-tools - do_with_root set -eu - do_with_root mkdir /opt/filewatcher - -do_with_root wget /opt/filewatcher/filewatcher.sh - -do_with_root ln -s /opt/filewatcher/filewatcher.sh /usr/local/bin/filewatcher +do_with_root wget https://git.schroedercity.com/voltron/Misc-Scripts/raw/master/filewatcher.sh /opt/filewatcher/filewatcher.sh do_with_root chmod +x /opt/filewatcher/filewatcher.sh +do_with_root ln -s /opt/filewatcher/filewatcher.sh /usr/local/bin/filewatcher echo "" echo -e "${CS[color,LightYellow]}Filewatcher has been Installed${CS[color,Default]}" echo "" -echo -e "To run updates, use the command: ${CS[color,Green]}runup${CS[color,Default]}" +echo -e "To run, use the command: ${CS[color,Green]}filewatcher {file_to_watch} {your_email_address}${CS[color,Default]}" echo "" echo "" diff --git a/filewatcher.sh b/filewatcher.sh index c57a07e..f776f6d 100755 --- a/filewatcher.sh +++ b/filewatcher.sh @@ -1,12 +1,12 @@ #!/bin/sh # # Monitor file $1 for changes -# Send an alert emai to $2 if file $1 changes -# usage: filewatcher /var/log/messages your.name@domain.com +# Send an alert email to $2 if file $1 changes +# usage: filewatcher {file_to_watch} {your_email_address} # if [ -z "$2" ]; then - echo "Usage: filewatcher /var/log/messages your.name@domain.com" + echo "Usage: filewatcher {file_to_watch} {your_email_address}" exit 1 fi