mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
0377b396c9 | |||
3fc319b650 | |||
f34471e044 | |||
de7e9b1c6d | |||
868314e244 | |||
7a8cc36a38 | |||
a3dce7fcbd | |||
0472faa2bf | |||
ae2eb77c7b |
@ -1 +1 @@
|
|||||||
__version__ = '2.9.3'
|
__version__ = '2.9.3-2'
|
||||||
|
@ -58,7 +58,7 @@ def check(version, repo, native=True):
|
|||||||
|
|
||||||
|
|
||||||
def make_path_for(name):
|
def make_path_for(name):
|
||||||
path = os.path.join("/opt/", name)
|
path = os.path.join("/home/pi/", name)
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
logging.debug("[update] deleting %s" % path)
|
logging.debug("[update] deleting %s" % path)
|
||||||
shutil.rmtree(path, ignore_errors=True, onerror=None)
|
shutil.rmtree(path, ignore_errors=True, onerror=None)
|
||||||
@ -138,10 +138,20 @@ def install(display, update):
|
|||||||
if not os.path.exists(source_path):
|
if not os.path.exists(source_path):
|
||||||
source_path = "%s-%s" % (source_path, update['available'])
|
source_path = "%s-%s" % (source_path, update['available'])
|
||||||
|
|
||||||
# setup.py is going to install data files for us
|
try:
|
||||||
# first we create a new virtual environment and activate it
|
# Activate the virtual environment and install the package
|
||||||
os.system("cd /home/pi && source .pwn/bin/activate")
|
subprocess.run(
|
||||||
os.system("cd %s && pip3 install ." % source_path)
|
["bash", "-c", f"source /home/pi/.pwn/bin/activate && pip install {source_path}"],
|
||||||
|
check=True
|
||||||
|
)
|
||||||
|
|
||||||
|
# Clean up the source directory
|
||||||
|
shutil.rmtree(source_path, ignore_errors=True)
|
||||||
|
|
||||||
|
except subprocess.CalledProcessError as e:
|
||||||
|
logging.error(f"Installation failed: {e}")
|
||||||
|
except Exception as e:
|
||||||
|
logging.error(f"Unexpected error: {e}")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ class BTTether(plugins.Plugin):
|
|||||||
file = f'''
|
file = f'''
|
||||||
[connection]
|
[connection]
|
||||||
id=bluetooth
|
id=bluetooth
|
||||||
|
interface-name=bnep0
|
||||||
type=bluetooth
|
type=bluetooth
|
||||||
autoconnect=yes
|
autoconnect=yes
|
||||||
[bluetooth]
|
[bluetooth]
|
||||||
|
@ -264,7 +264,7 @@ class PiSugar(plugins.Plugin):
|
|||||||
if self.drot == 0: # show battery voltage
|
if self.drot == 0: # show battery voltage
|
||||||
ui.set('bat', f"{voltage:.2f}V")
|
ui.set('bat', f"{voltage:.2f}V")
|
||||||
elif self.drot == 1: # show battery capacity
|
elif self.drot == 1: # show battery capacity
|
||||||
ui.set('bat', f"{capacity}%")
|
ui.set('bat', f"{capacity:.0f}%")
|
||||||
else: # show battery temperature
|
else: # show battery temperature
|
||||||
ui.set('bat', f"{temp}°C")
|
ui.set('bat', f"{temp}°C")
|
||||||
else:
|
else:
|
||||||
@ -272,7 +272,7 @@ class PiSugar(plugins.Plugin):
|
|||||||
if self.default_display == 'voltage':
|
if self.default_display == 'voltage':
|
||||||
ui.set('bat', f"{voltage:.2f}V")
|
ui.set('bat', f"{voltage:.2f}V")
|
||||||
elif self.default_display in ['percentage', 'percent']:
|
elif self.default_display in ['percentage', 'percent']:
|
||||||
ui.set('bat', f"{capacity}%")
|
ui.set('bat', f"{capacity:.0f}%")
|
||||||
elif self.default_display == 'temp':
|
elif self.default_display == 'temp':
|
||||||
ui.set('bat', f"{temp}°C")
|
ui.set('bat', f"{temp}°C")
|
||||||
|
|
||||||
@ -283,4 +283,4 @@ class PiSugar(plugins.Plugin):
|
|||||||
logging.info(
|
logging.info(
|
||||||
f"[PiSugarX] Empty battery (<= {safe_shutdown_level}%): shutting down"
|
f"[PiSugarX] Empty battery (<= {safe_shutdown_level}%): shutting down"
|
||||||
)
|
)
|
||||||
ui.update(force=True, new_data={"status": "Battery exhausted, bye ..."})
|
ui.update(force=True, new_data={"status": "Battery exhausted, bye ..."})
|
||||||
|
@ -32,8 +32,7 @@ OUTPUT=${OUTPUT:-${UNIT_HOSTNAME}-backup-$(date +%s).tgz}
|
|||||||
# username to use for ssh
|
# username to use for ssh
|
||||||
UNIT_USERNAME=${UNIT_USERNAME:-pi}
|
UNIT_USERNAME=${UNIT_USERNAME:-pi}
|
||||||
# what to backup
|
# what to backup
|
||||||
FILES_TO_BACKUP="
|
FILES_TO_BACKUP="/boot/firmware/cmdline.txt \
|
||||||
/boot/firmware/cmdline.txt \
|
|
||||||
/boot/firmware/config.txt \
|
/boot/firmware/config.txt \
|
||||||
/root/settings.yaml \
|
/root/settings.yaml \
|
||||||
/root/client_secrets.json \
|
/root/client_secrets.json \
|
||||||
|
Reference in New Issue
Block a user