Getting installed Phantombot version

PhantomBot Version: 3.0.0 (Revision: fcc08b51)
Operating System: Linux
Java Version: 1.8.0_201-b09
Stock PhantomBot: Yes

I’m writing an update script because I host several bots for my friends and (for the same reason many scripts exist) I can’t be bothered to update them all manually.
I wanted a reliable way to get the currently installed version of PhantomBot, so far I’m doing this by greping the systemd journal logs, which is not so elegant.

I tried searching many files and even the SQLite db, but only found the phantombot_updates table which is as close as I got to finding a version number. I’ve updated to 3.0.0 which is also reported on the web panel, but the latest version shown in the phantombot_updates table is installedv2.4.2.1

Is there a more reliable and accurate method of getting the installed version?

You could pull the manifest using unzip -q -c PhantomBot.jar META-INF/MANIFEST.MF

The -c parameter will cause unzip to output to STDOUT, so you can then just pipe it into a grep or something

The key lines to parse are Implementation-Version and Implementation-Revision

Perfect, that gets the exact information I needed. Thank you :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.