Fix file_changed function for non-existent files.
parent
21f795acb7
commit
521aea6b47
|
@ -1,6 +1,16 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
|
||||||
file_changed() {
|
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}')"
|
oldfilehash="$(sha1sum "$1" | awk '{print $1}')"
|
||||||
newfilehash="$(sha1sum "$2" | awk '{print $1}')"
|
newfilehash="$(sha1sum "$2" | awk '{print $1}')"
|
||||||
[ "${oldfilehash}" != "${newfilehash}" ]
|
[ "${oldfilehash}" != "${newfilehash}" ]
|
||||||
|
|
Loading…
Reference in New Issue