~gbmor/clinte

a0d9d84d424efc86f1ab78c88c479a60b7ed841a — Ben Morrison 1 year, 6 days ago 39ca959
testing for OS to improve portability of new post notification
1 files changed, 11 insertions(+), 3 deletions(-)

M check_new_clinte_posts.sh
M check_new_clinte_posts.sh => check_new_clinte_posts.sh +11 -3
@@ 1,10 1,18 @@
#!/bin/sh

LOCAL_FILE="$HOME/.clinte.json"
LOCAL_HASH=$(sha256sum "$LOCAL_FILE" 2>/dev/null | cut -d' ' -f1)
OS=$(uname)

LOCAL_FILE="$HOME/.clinte.json"
DBFILE="/usr/local/clinte/clinte.json"
DBFILE_HASH=$(sha256sum "$DBFILE" | cut -d' ' -f1)

if [ $OS = "Linux" ]
then
    LOCAL_HASH=$(sha256sum "$LOCAL_FILE" 2>/dev/null | cut -d' ' -f1)
    DBFILE_HASH=$(sha256sum "$DBFILE" | cut -d' ' -f1)
else
    LOCAL_HASH=$(sha256 "$LOCAL_FILE" 2>/dev/null | cut -d' ' -f1)
    DBFILE_HASH=$(sha256 "$DBFILE" | cut -d' ' -f1)
fi

if [ "$LOCAL_HASH" != "$DBFILE_HASH" ]
then