diff --git a/buildscripts/appimage.sh b/buildscripts/appimage.sh
index 3a89d941..a5691783 100755
--- a/buildscripts/appimage.sh
+++ b/buildscripts/appimage.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 # Cleanup
 rm -rf PyBitmessage
@@ -18,10 +18,18 @@ fi
 
 ./pkg2appimage packages/AppImage/PyBitmessage.yml
 
-if [ -f "out/PyBitmessage-${VERSION}.glibc2.15-x86_64.AppImage" ]; then
+./pkg2appimage --appimage-extract
+
+. ./squashfs-root/usr/share/pkg2appimage/functions.sh
+
+GLIBC=$(glibc_needed)
+
+VERSION_EXPANDED=${VERSION}.glibc${GLIBC}-${SYSTEM_ARCH}
+
+if [ -f "out/PyBitmessage-${VERSION_EXPANDED}.AppImage" ]; then
     echo "Build Successful";
-    echo "Run out/PyBitmessage-${VERSION}.glibc2.15-x86_64.AppImage";
-    out/PyBitmessage-${VERSION}.glibc2.15-x86_64.AppImage -t
+    echo "Run out/PyBitmessage-${VERSION_EXPANDED}.AppImage";
+    out/PyBitmessage-${VERSION_EXPANDED}.AppImage -t
 else
     echo "Build Failed";
     exit 1