Fix bug where update fails when run from another path

This commit is contained in:
Liam McLoughlin
2012-04-21 16:57:46 +00:00
parent 80c996159a
commit ac4f9d1aec

View File

@@ -27,7 +27,7 @@ function update_self() {
tail --lines=+2 "$_payloadName" >> "$_tempFileName"
rm "$_payloadName"
OCTAL_MODE=$(stat -c '%a' $SELF)
OCTAL_MODE=$(stat -c '%a' $0)
if ! chmod $OCTAL_MODE "$_tempFileName" ; then
echo "Failed: Error while trying to set mode on $_tempFileName."
exit 1