commit
3252f9b401
@ -42,24 +42,24 @@ class AutoBackup(plugins.Plugin):
|
|||||||
try:
|
try:
|
||||||
display = agent.view()
|
display = agent.view()
|
||||||
|
|
||||||
logging.info("AUTO-BACKUP: Backing up ...")
|
logging.info("AUTO_BACKUP: Backing up ...")
|
||||||
display.set('status', 'Backing up ...')
|
display.set('status', 'Backing up ...')
|
||||||
display.update()
|
display.update()
|
||||||
|
|
||||||
for cmd in self.options['commands']:
|
for cmd in self.options['commands']:
|
||||||
logging.info(f"AUTO-BACKUP: Running {cmd.format(files=files_to_backup)}")
|
logging.info(f"AUTO_BACKUP: Running {cmd.format(files=files_to_backup)}")
|
||||||
process = subprocess.Popen(cmd.format(files=files_to_backup), shell=True, stdin=None,
|
process = subprocess.Popen(cmd.format(files=files_to_backup), shell=True, stdin=None,
|
||||||
stdout=open("/dev/null", "w"), stderr=None, executable="/bin/bash")
|
stdout=open("/dev/null", "w"), stderr=None, executable="/bin/bash")
|
||||||
process.wait()
|
process.wait()
|
||||||
if process.returncode > 0:
|
if process.returncode > 0:
|
||||||
raise OSError(f"Command failed (rc: {process.returncode})")
|
raise OSError(f"Command failed (rc: {process.returncode})")
|
||||||
|
|
||||||
logging.info("AUTO-BACKUP: backup done")
|
logging.info("AUTO_BACKUP: backup done")
|
||||||
display.set('status', 'Backup done!')
|
display.set('status', 'Backup done!')
|
||||||
display.update()
|
display.update()
|
||||||
self.status.update()
|
self.status.update()
|
||||||
except OSError as os_e:
|
except OSError as os_e:
|
||||||
self.tries += 1
|
self.tries += 1
|
||||||
logging.info(f"AUTO-BACKUP: Error: {os_e}")
|
logging.info(f"AUTO_BACKUP: Error: {os_e}")
|
||||||
display.set('status', 'Backup failed!')
|
display.set('status', 'Backup failed!')
|
||||||
display.update()
|
display.update()
|
||||||
|
@ -18,7 +18,43 @@ TEMPLATE = """
|
|||||||
{{ title }}
|
{{ title }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block styles %}
|
||||||
|
{{ super() }}
|
||||||
|
<style>
|
||||||
|
#filter {
|
||||||
|
width: 100%;
|
||||||
|
font-size: 16px;
|
||||||
|
padding: 12px 20px 12px 40px;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
{% endblock %}
|
||||||
|
{% block script %}
|
||||||
|
var shakeList = document.getElementById('list');
|
||||||
|
var filter = document.getElementById('filter');
|
||||||
|
var filterVal = filter.value.toUpperCase();
|
||||||
|
|
||||||
|
filter.onkeyup = function() {
|
||||||
|
document.body.style.cursor = 'progress';
|
||||||
|
var table, tr, tds, td, i, txtValue;
|
||||||
|
filterVal = filter.value.toUpperCase();
|
||||||
|
li = shakeList.getElementsByTagName("li");
|
||||||
|
for (i = 0; i < li.length; i++) {
|
||||||
|
txtValue = li[i].textContent || li[i].innerText;
|
||||||
|
if (txtValue.toUpperCase().indexOf(filterVal) > -1) {
|
||||||
|
li[i].style.display = "list-item";
|
||||||
|
} else {
|
||||||
|
li[i].style.display = "none";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
document.body.style.cursor = 'default';
|
||||||
|
}
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
<input type="text" id="filter" placeholder="Search for ..." title="Type in a filter">
|
||||||
<ul id="list" data-role="listview" style="list-style-type:disc;">
|
<ul id="list" data-role="listview" style="list-style-type:disc;">
|
||||||
{% for handshake in handshakes %}
|
{% for handshake in handshakes %}
|
||||||
<li class="file">
|
<li class="file">
|
||||||
@ -31,7 +67,7 @@ TEMPLATE = """
|
|||||||
|
|
||||||
class HandshakesDL(plugins.Plugin):
|
class HandshakesDL(plugins.Plugin):
|
||||||
__author__ = 'me@sayakb.com'
|
__author__ = 'me@sayakb.com'
|
||||||
__version__ = '0.1.0'
|
__version__ = '0.2.1'
|
||||||
__license__ = 'GPL3'
|
__license__ = 'GPL3'
|
||||||
__description__ = 'Download handshake captures from web-ui.'
|
__description__ = 'Download handshake captures from web-ui.'
|
||||||
|
|
||||||
@ -41,12 +77,8 @@ class HandshakesDL(plugins.Plugin):
|
|||||||
def on_loaded(self):
|
def on_loaded(self):
|
||||||
logging.info("[HandshakesDL] plugin loaded")
|
logging.info("[HandshakesDL] plugin loaded")
|
||||||
|
|
||||||
def on_ready(self, agent):
|
def on_config_changed(self, config):
|
||||||
self.config = agent.config()
|
self.config = config
|
||||||
self.ready = True
|
|
||||||
|
|
||||||
def on_internet_available(self, agent):
|
|
||||||
self.config = agent.config()
|
|
||||||
self.ready = True
|
self.ready = True
|
||||||
|
|
||||||
def on_webhook(self, path, request):
|
def on_webhook(self, path, request):
|
||||||
|
13
hashie.py
13
hashie.py
@ -12,7 +12,7 @@ import pwnagotchi.ui.fonts as fonts
|
|||||||
|
|
||||||
class hashie(plugins.Plugin):
|
class hashie(plugins.Plugin):
|
||||||
__author__ = 'junohea.mail@gmail.com'
|
__author__ = 'junohea.mail@gmail.com'
|
||||||
__version__ = '1.0.0'
|
__version__ = '1.0.1'
|
||||||
__license__ = 'GPL3'
|
__license__ = 'GPL3'
|
||||||
__description__ = '''
|
__description__ = '''
|
||||||
Attempt to automatically convert pcaps to a crackable format.
|
Attempt to automatically convert pcaps to a crackable format.
|
||||||
@ -53,17 +53,8 @@ class hashie(plugins.Plugin):
|
|||||||
logging.info("[hashie] plugin loaded")
|
logging.info("[hashie] plugin loaded")
|
||||||
self.lock = Lock()
|
self.lock = Lock()
|
||||||
|
|
||||||
# called when the plugin is loaded
|
|
||||||
def on_loaded(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
# called when there's internet connectivity
|
|
||||||
def on_internet_available(self, agent):
|
|
||||||
pass
|
|
||||||
|
|
||||||
# called when everything is ready and the main loop is about to start
|
# called when everything is ready and the main loop is about to start
|
||||||
def on_ready(self, agent):
|
def on_config_changed(self, config):
|
||||||
config = agent.config()
|
|
||||||
handshake_dir = config['bettercap']['handshakes']
|
handshake_dir = config['bettercap']['handshakes']
|
||||||
|
|
||||||
if 'interval' not in self.options or not (self.status.newer_then_hours(self.options['interval'])):
|
if 'interval' not in self.options or not (self.status.newer_then_hours(self.options['interval'])):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user