fix: keep led on to understand when the unit is still alive
This commit is contained in:
parent
5725d8b239
commit
cf1558eb29
@ -10,8 +10,3 @@ done
|
|||||||
|
|
||||||
echo 0 >/sys/class/leds/led0/brightness
|
echo 0 >/sys/class/leds/led0/brightness
|
||||||
sleep 0.3
|
sleep 0.3
|
||||||
|
|
||||||
# Powersave options
|
|
||||||
# Disable power LED ~30ma
|
|
||||||
echo none >/sys/class/leds/led0/trigger
|
|
||||||
echo 1 >/sys/class/leds/led0/brightness
|
|
||||||
|
@ -17,44 +17,36 @@ class Voice:
|
|||||||
def default(self):
|
def default(self):
|
||||||
return self._('ZzzzZZzzzzZzzz')
|
return self._('ZzzzZZzzzzZzzz')
|
||||||
|
|
||||||
|
|
||||||
def on_starting(self):
|
def on_starting(self):
|
||||||
return random.choice([ \
|
return random.choice([ \
|
||||||
self._('Hi, I\'m Pwnagotchi!\nStarting ...'),
|
self._('Hi, I\'m Pwnagotchi!\nStarting ...'),
|
||||||
self._('New day, new hunt,\nnew pwns!'),
|
self._('New day, new hunt,\nnew pwns!'),
|
||||||
self._('Hack the Planet!')])
|
self._('Hack the Planet!')])
|
||||||
|
|
||||||
|
|
||||||
def on_ai_ready(self):
|
def on_ai_ready(self):
|
||||||
return random.choice([
|
return random.choice([
|
||||||
self._('AI ready.'),
|
self._('AI ready.'),
|
||||||
self._('The neural network\nis ready.')])
|
self._('The neural network\nis ready.')])
|
||||||
|
|
||||||
|
|
||||||
def on_normal(self):
|
def on_normal(self):
|
||||||
return random.choice([ \
|
return random.choice([ \
|
||||||
'',
|
'',
|
||||||
'...'])
|
'...'])
|
||||||
|
|
||||||
|
|
||||||
def on_free_channel(self, channel):
|
def on_free_channel(self, channel):
|
||||||
return self._('Hey, channel {channel} is\nfree! Your AP will\nsay thanks.').format(channel=channel)
|
return self._('Hey, channel {channel} is\nfree! Your AP will\nsay thanks.').format(channel=channel)
|
||||||
|
|
||||||
|
|
||||||
def on_bored(self):
|
def on_bored(self):
|
||||||
return random.choice([ \
|
return random.choice([ \
|
||||||
self._('I\'m bored ...'),
|
self._('I\'m bored ...'),
|
||||||
self._('Let\'s go for a walk!')])
|
self._('Let\'s go for a walk!')])
|
||||||
|
|
||||||
|
|
||||||
def on_motivated(self, reward):
|
def on_motivated(self, reward):
|
||||||
return self._('This is the best\nday of my life!')
|
return self._('This is the best\nday of my life!')
|
||||||
|
|
||||||
|
|
||||||
def on_demotivated(self, reward):
|
def on_demotivated(self, reward):
|
||||||
return self._('Shitty day :/')
|
return self._('Shitty day :/')
|
||||||
|
|
||||||
|
|
||||||
def on_sad(self):
|
def on_sad(self):
|
||||||
return random.choice([ \
|
return random.choice([ \
|
||||||
self._('I\'m extremely bored ...'),
|
self._('I\'m extremely bored ...'),
|
||||||
@ -62,7 +54,6 @@ class Voice:
|
|||||||
self._('I\'m sad'),
|
self._('I\'m sad'),
|
||||||
'...'])
|
'...'])
|
||||||
|
|
||||||
|
|
||||||
def on_excited(self):
|
def on_excited(self):
|
||||||
return random.choice([ \
|
return random.choice([ \
|
||||||
self._('I\'m living the life!'),
|
self._('I\'m living the life!'),
|
||||||
@ -71,51 +62,43 @@ class Voice:
|
|||||||
self._('I\'m having so much\nfun!'),
|
self._('I\'m having so much\nfun!'),
|
||||||
self._('My crime is that of\ncuriosity ...')])
|
self._('My crime is that of\ncuriosity ...')])
|
||||||
|
|
||||||
|
|
||||||
def on_new_peer(self, peer):
|
def on_new_peer(self, peer):
|
||||||
return random.choice([ \
|
return random.choice([ \
|
||||||
self._('Hello\n{name}!\nNice to meet you. {name}').format(name=peer.name()),
|
self._('Hello\n{name}!\nNice to meet you. {name}').format(name=peer.name()),
|
||||||
self._('Unit\n{name}\nis nearby! {name}').format(name=peer.name())])
|
self._('Unit\n{name}\nis nearby! {name}').format(name=peer.name())])
|
||||||
|
|
||||||
|
|
||||||
def on_lost_peer(self, peer):
|
def on_lost_peer(self, peer):
|
||||||
return random.choice([ \
|
return random.choice([ \
|
||||||
self._('Uhm ...\ngoodbye\n{name}').format(name=peer.name()),
|
self._('Uhm ...\ngoodbye\n{name}').format(name=peer.name()),
|
||||||
self._('{name}\nis gone ...').format(name=peer.name())])
|
self._('{name}\nis gone ...').format(name=peer.name())])
|
||||||
|
|
||||||
|
|
||||||
def on_miss(self, who):
|
def on_miss(self, who):
|
||||||
return random.choice([ \
|
return random.choice([ \
|
||||||
self._('Whoops ...\n{name}\nis gone.').format(name=who),
|
self._('Whoops ...\n{name}\nis gone.').format(name=who),
|
||||||
self._('{name}\nmissed!').format(name=who),
|
self._('{name}\nmissed!').format(name=who),
|
||||||
self._('Missed!')])
|
self._('Missed!')])
|
||||||
|
|
||||||
|
|
||||||
def on_lonely(self):
|
def on_lonely(self):
|
||||||
return random.choice([ \
|
return random.choice([ \
|
||||||
self._('Nobody wants to\nplay with me ...'),
|
self._('Nobody wants to\nplay with me ...'),
|
||||||
self._('I feel so alone ...'),
|
self._('I feel so alone ...'),
|
||||||
self._('Where\'s everybody?!')])
|
self._('Where\'s everybody?!')])
|
||||||
|
|
||||||
|
|
||||||
def on_napping(self, secs):
|
def on_napping(self, secs):
|
||||||
return random.choice([ \
|
return random.choice([ \
|
||||||
self._('Napping for {secs}s ...').format(secs=secs),
|
self._('Napping for {secs}s ...').format(secs=secs),
|
||||||
self._('Zzzzz'),
|
self._('Zzzzz'),
|
||||||
self._('ZzzZzzz ({secs}s)').format(secs=secs)])
|
self._('ZzzZzzz ({secs}s)').format(secs=secs)])
|
||||||
|
|
||||||
|
|
||||||
def on_awakening(self):
|
def on_awakening(self):
|
||||||
return random.choice(['...', '!'])
|
return random.choice(['...', '!'])
|
||||||
|
|
||||||
|
|
||||||
def on_waiting(self, secs):
|
def on_waiting(self, secs):
|
||||||
return random.choice([ \
|
return random.choice([ \
|
||||||
self._('Waiting for {secs}s ...').format(secs=secs),
|
self._('Waiting for {secs}s ...').format(secs=secs),
|
||||||
'...',
|
'...',
|
||||||
self._('Looking around ({secs}s)').format(secs=secs)])
|
self._('Looking around ({secs}s)').format(secs=secs)])
|
||||||
|
|
||||||
|
|
||||||
def on_assoc(self, ap):
|
def on_assoc(self, ap):
|
||||||
ssid, bssid = ap['hostname'], ap['mac']
|
ssid, bssid = ap['hostname'], ap['mac']
|
||||||
what = ssid if ssid != '' and ssid != '<hidden>' else bssid
|
what = ssid if ssid != '' and ssid != '<hidden>' else bssid
|
||||||
@ -124,23 +107,19 @@ class Voice:
|
|||||||
self._('Associating to\n{what}').format(what=what),
|
self._('Associating to\n{what}').format(what=what),
|
||||||
self._('Yo\n{what}!').format(what=what)])
|
self._('Yo\n{what}!').format(what=what)])
|
||||||
|
|
||||||
|
def on_deauth(self, sta):
|
||||||
def on_deauth(self,sta):
|
|
||||||
return random.choice([ \
|
return random.choice([ \
|
||||||
self._('Just decided that\n{mac}\nneeds no WiFi!').format(mac=sta['mac']),
|
self._('Just decided that\n{mac}\nneeds no WiFi!').format(mac=sta['mac']),
|
||||||
self._('Deauthenticating\n{mac}').format(mac=sta['mac']),
|
self._('Deauthenticating\n{mac}').format(mac=sta['mac']),
|
||||||
self._('Kickbanning\n{mac}!').format(mac=sta['mac'])])
|
self._('Kickbanning\n{mac}!').format(mac=sta['mac'])])
|
||||||
|
|
||||||
|
|
||||||
def on_handshakes(self, new_shakes):
|
def on_handshakes(self, new_shakes):
|
||||||
s = 's' if new_shakes > 1 else ''
|
s = 's' if new_shakes > 1 else ''
|
||||||
return self._('Cool, we got {num}\nnew handshake{plural}!').format(num=new_shakes, plural=s)
|
return self._('Cool, we got {num}\nnew handshake{plural}!').format(num=new_shakes, plural=s)
|
||||||
|
|
||||||
|
|
||||||
def on_rebooting(self):
|
def on_rebooting(self):
|
||||||
return self._("Ops, something\nwent wrong ...\nRebooting ...")
|
return self._("Ops, something\nwent wrong ...\nRebooting ...")
|
||||||
|
|
||||||
|
|
||||||
def on_log(self, log):
|
def on_log(self, log):
|
||||||
status = self._('Kicked {num} stations\n').format(num=log.deauthed)
|
status = self._('Kicked {num} stations\n').format(num=log.deauthed)
|
||||||
status += self._('Made {num} new friends\n').format(num=log.associated)
|
status += self._('Made {num} new friends\n').format(num=log.associated)
|
||||||
@ -151,10 +130,10 @@ class Voice:
|
|||||||
status += self._('Met {num} peers').format(num=log.peers)
|
status += self._('Met {num} peers').format(num=log.peers)
|
||||||
return status
|
return status
|
||||||
|
|
||||||
|
|
||||||
def on_log_tweet(self, log):
|
def on_log_tweet(self, log):
|
||||||
return self._('I\'ve been pwning for {duration} and kicked {deauthed} clients! I\'ve also met {associated} new friends and ate {handshakes} handshakes! #pwnagotchi #pwnlog #pwnlife #hacktheplanet #skynet').format(
|
return self._(
|
||||||
duration=log.duration_human,
|
'I\'ve been pwning for {duration} and kicked {deauthed} clients! I\'ve also met {associated} new friends and ate {handshakes} handshakes! #pwnagotchi #pwnlog #pwnlife #hacktheplanet #skynet').format(
|
||||||
deauthed=log.deauthed,
|
duration=log.duration_human,
|
||||||
associated=log.associated,
|
deauthed=log.deauthed,
|
||||||
handshakes=log.handshakes)
|
associated=log.associated,
|
||||||
|
handshakes=log.handshakes)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user