diff --git a/home/bin/update-profile b/home/bin/update-profile index 4914b25..0e49f08 100755 --- a/home/bin/update-profile +++ b/home/bin/update-profile @@ -1,6 +1,16 @@ #!/bin/sh -e file_changed() { + if [ ! -f "$1" ]; then + if [ ! -f "$2" ]; then + return 0 + else + return 1 + fi + fi + if [ ! -f "$2" ]; then + return 1 + fi oldfilehash="$(sha1sum "$1" | awk '{print $1}')" newfilehash="$(sha1sum "$2" | awk '{print $1}')" [ "${oldfilehash}" != "${newfilehash}" ]