diff --git a/upgrade_all.sh b/upgrade_all.sh
index 45276829e29714036d124cc6bca70fe9332c4bfa..cedfa9f409da6d78401f1e0ec1ace45a3c364e3b 100755
--- a/upgrade_all.sh
+++ b/upgrade_all.sh
@@ -1,3 +1,5 @@
 #!/bin/bash
+DIR=$(realpath $(dirname $0))
+cd $DIR
 git pull
-`dirname $0`/do_postinstall.sh
+$DIR/do_postinstall.sh