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):
|
||||
path = os.path.join("/opt/", name)
|
||||
path = os.path.join("/home/pi/", name)
|
||||
if os.path.exists(path):
|
||||
logging.debug("[update] deleting %s" % path)
|
||||
shutil.rmtree(path, ignore_errors=True, onerror=None)
|
||||
@ -138,10 +138,20 @@ def install(display, update):
|
||||
if not os.path.exists(source_path):
|
||||
source_path = "%s-%s" % (source_path, update['available'])
|
||||
|
||||
# setup.py is going to install data files for us
|
||||
# first we create a new virtual environment and activate it
|
||||
os.system("cd /home/pi && source .pwn/bin/activate")
|
||||
os.system("cd %s && pip3 install ." % source_path)
|
||||
try:
|
||||
# Activate the virtual environment and install the package
|
||||
subprocess.run(
|
||||
["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
|
||||
|
||||
|
||||
|
@ -30,6 +30,7 @@ class BTTether(plugins.Plugin):
|
||||
file = f'''
|
||||
[connection]
|
||||
id=bluetooth
|
||||
interface-name=bnep0
|
||||
type=bluetooth
|
||||
autoconnect=yes
|
||||
[bluetooth]
|
||||
|
@ -264,7 +264,7 @@ class PiSugar(plugins.Plugin):
|
||||
if self.drot == 0: # show battery voltage
|
||||
ui.set('bat', f"{voltage:.2f}V")
|
||||
elif self.drot == 1: # show battery capacity
|
||||
ui.set('bat', f"{capacity}%")
|
||||
ui.set('bat', f"{capacity:.0f}%")
|
||||
else: # show battery temperature
|
||||
ui.set('bat', f"{temp}°C")
|
||||
else:
|
||||
@ -272,7 +272,7 @@ class PiSugar(plugins.Plugin):
|
||||
if self.default_display == 'voltage':
|
||||
ui.set('bat', f"{voltage:.2f}V")
|
||||
elif self.default_display in ['percentage', 'percent']:
|
||||
ui.set('bat', f"{capacity}%")
|
||||
ui.set('bat', f"{capacity:.0f}%")
|
||||
elif self.default_display == 'temp':
|
||||
ui.set('bat', f"{temp}°C")
|
||||
|
||||
|
@ -32,8 +32,7 @@ OUTPUT=${OUTPUT:-${UNIT_HOSTNAME}-backup-$(date +%s).tgz}
|
||||
# username to use for ssh
|
||||
UNIT_USERNAME=${UNIT_USERNAME:-pi}
|
||||
# what to backup
|
||||
FILES_TO_BACKUP="
|
||||
/boot/firmware/cmdline.txt \
|
||||
FILES_TO_BACKUP="/boot/firmware/cmdline.txt \
|
||||
/boot/firmware/config.txt \
|
||||
/root/settings.yaml \
|
||||
/root/client_secrets.json \
|
||||
|
Reference in New Issue
Block a user