63568f1725d062b1316b10434d7ccf38e1408b70,pwnagotchi/plugins/default/auto-update.py,,on_internet_available,#,117

Before Change


            logging.error("[update] %s" % e)

        logging.debug("[update] setting status "%s"" % prev_status)
        display.set("status", prev_status if prev_status is not None else "")
        display.update(force=True)

After Change


        prev_status = display.get("status")

        try:
            display.update(force=True, new_data={"status": "Checking for updates ..."})

            to_install = []
            to_check = [
                (
                    "bettercap/bettercap", subprocess.getoutput("bettercap -version").split(" ")[1].replace("v", ""),
                    True),
                ("evilsocket/pwngrid", subprocess.getoutput("pwngrid -version").replace("v", ""), True),
                ("evilsocket/pwnagotchi", pwnagotchi.version, False)
            ]

            for repo, local_version, is_native in to_check:
                info = check(local_version, repo, is_native)
                if info["url"] is not None:
                    logging.warning("update for %s available: %s" % (repo, info["url"]))
                    to_install.append(info)

            num_updates = len(to_install)
            if num_updates > 0:
                if OPTIONS["install"]:
                    for update in to_install:
                        install(display, update)
                else:
                    prev_status = "%d new update%c available!" % (num_updates, "s" if num_updates > 1 else "")

            logging.info("[update] done")

            STATUS.update()

        except Exception as e:
            logging.error("[update] %s" % e)

        logging.debug("[update] setting status "%s"" % prev_status)
        display.update(force=True, new_data={"status": prev_status if prev_status is not None else ""})
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: evilsocket/pwnagotchi
Commit Name: 63568f1725d062b1316b10434d7ccf38e1408b70
Time: 2019-10-20
Author: evilsocket@gmail.com
File Name: pwnagotchi/plugins/default/auto-update.py
Class Name:
Method Name: on_internet_available


Project Name: evilsocket/pwnagotchi
Commit Name: 63568f1725d062b1316b10434d7ccf38e1408b70
Time: 2019-10-20
Author: evilsocket@gmail.com
File Name: pwnagotchi/plugins/default/auto-update.py
Class Name:
Method Name: install