Merge branch 'pwnagotchi-torch' of https://github.com/jayofelony/pwnagotchi-torch into pwnagotchi-torch

This commit is contained in:
Jeroen Oudshoorn
2023-11-14 21:41:21 +01:00
6 changed files with 27 additions and 17 deletions

View File

@ -35,18 +35,18 @@ msgid "The neural network is ready."
msgstr "Neuronen netwerk is klaar."
msgid "Generating keys, do not turn off ..."
msgstr ""
msgstr "Sleutel genereren, niet afsluiten ..."
#, python-brace-format
msgid "Hey, channel {channel} is free! Your AP will say thanks."
msgstr "Hey, kanaal {channel} is vrij! Je AP zal je bedanken."
msgid "Reading last session logs ..."
msgstr ""
msgstr "Logs laatste sessie lezen ..."
#, python-brace-format
msgid "Read {lines_so_far} log lines so far ..."
msgstr ""
msgstr "{lines_so_far} log regels gelezer tot nu toe ..."
msgid "I'm bored ..."
msgstr "Ik verveel me ..."
@ -74,7 +74,7 @@ msgid "Leave me alone ..."
msgstr "Ik voel me zo alleen ..."
msgid "I'm mad at you!"
msgstr ""
msgstr "Ik ben boos op jou!"
msgid "I'm living the life!"
msgstr "Beter kan het leven niet worden!"
@ -97,11 +97,11 @@ msgstr "Hallo {name}! Leuk je te ontmoeten. {name}"
#, python-brace-format
msgid "Yo {name}! Sup?"
msgstr ""
msgstr "Hey {name}! Hoe gaatie?"
#, python-brace-format
msgid "Hey {name} how are you doing?"
msgstr ""
msgstr "Hey {name}, hoe gaat het met je?"
#, fuzzy, python-brace-format
msgid "Unit {name} is nearby!"
@ -127,10 +127,10 @@ msgid "Missed!"
msgstr "Gemist!"
msgid "Good friends are a blessing!"
msgstr ""
msgstr "Goede vrienden zijn een geschenk!"
msgid "I love my friends!"
msgstr ""
msgstr "Ik houd van mijn vrienden!"
msgid "Nobody wants to play with me ..."
msgstr "Niemand wil met mij spelen ..."
@ -153,7 +153,7 @@ msgid "ZzzZzzz ({secs}s)"
msgstr "ZzzZzzz ({secs}s)"
msgid "Good night."
msgstr ""
msgstr "Goede nacht."
#, fuzzy
msgid "Zzz"
@ -200,11 +200,11 @@ msgid "You have {count} new message{plural}!"
msgstr "Cool, we hebben {num} nieuwe handshake{plural}!"
msgid "Oops, something went wrong ... Rebooting ..."
msgstr "Oops, er ging iets fout ...Rebooting ..."
msgstr "Oops, er ging iets fout ...Opnieuw opstarten ..."
#, python-brace-format
msgid "Uploading data to {to} ..."
msgstr ""
msgstr "Data uploaden naar {to}"
#, python-brace-format
msgid "Kicked {num} stations\n"

View File

@ -61,4 +61,5 @@ ping -c 1 "${UNIT_HOSTNAME}" > /dev/null 2>&1 || {
}
echo "@ backing up $UNIT_HOSTNAME to $OUTPUT ..."
# shellcheck disable=SC2029
ssh "${UNIT_USERNAME}@${UNIT_HOSTNAME}" "sudo find ${FILES_TO_BACKUP} -type f -print0 | xargs -0 sudo tar cv" | gzip -9 > "$OUTPUT"

View File

@ -5,7 +5,7 @@ USB_IFACE=''
USB_IP=${2:-10.0.0.1}
for i in $(ifconfig -lu); do
if ifconfig $i | grep -q "${USB_IP}" ; then USB_IFACE=$i; fi;
if ifconfig "$i" | grep -q "${USB_IP}" ; then USB_IFACE=$i; fi;
done
if [ -z "$USB_IFACE" ]

View File

@ -3,13 +3,15 @@
USB_IFACE=$(ifconfig urndis0 | grep urndis0 | awk '{print $1}' | tr -d ':')
USB_IP=${2:-10.0.0.1}
# shellcheck disable=SC2046
if test $(whoami) != root; then
doas "$0" "$@"
exit $?
fi
# shellcheck disable=SC2039
if [ "${USB_IFACE}" == "urndis0" ]; then
ifconfig ${USB_IFACE} ${USB_IP}
ifconfig "${USB_IFACE}" "${USB_IP}"
sysctl -w net.inet.ip.forwarding=1
echo "match out on egress inet from ${USB_IFACE}:network to any nat-to (egress:0)" | pfctl -f -
pfctl -f /etc/pf.conf

View File

@ -27,15 +27,20 @@ done
# name of the ethernet gadget interface on the host
UNIT_HOSTNAME=${UNIT_HOSTNAME:-10.0.0.2}
# output backup tgz file
# shellcheck disable=SC2086
if [ -z $BACKUP ]; then
BACKUP=$(ls -rt ${UNIT_HOSTNAME}-backup-*.tgz 2>/dev/null | tail -n1)
if [ -z $BACKUP ]; then
# shellcheck disable=SC2012
BACKUP=$(ls -rt "${UNIT_HOSTNAME}"-backup-*.tgz 2>/dev/null | tail -n1)
if [ -z "$BACKUP" ]; then
echo "@ Can't find backup file. Please specify one with '-b'"
exit 1
fi
echo "@ Found backup file:"
# shellcheck disable=SC2028
echo "\t${BACKUP}"
# shellcheck disable=SC2039
echo -n "@ continue restroring this file? (y/n) "
# shellcheck disable=SC2162
read CONTINUE
CONTINUE=$(echo "${CONTINUE}" | tr "[:upper:]" "[:lower:]")
if [ "${CONTINUE}" != "y" ]; then
@ -51,4 +56,5 @@ ping -c 1 "${UNIT_HOSTNAME}" > /dev/null 2>&1 || {
}
echo "@ restoring $BACKUP to $UNIT_HOSTNAME ..."
cat ${BACKUP} | ssh "${UNIT_USERNAME}@${UNIT_HOSTNAME}" "sudo tar xzv -C /"
# shellcheck disable=SC2002
cat "${BACKUP}" | ssh "${UNIT_USERNAME}@${UNIT_HOSTNAME}" "sudo tar xzv -C /"

View File

@ -11,6 +11,7 @@ import warnings
log = logging.getLogger(__name__)
def install_file(source_filename, dest_filename):
# do not overwrite network configuration if it exists already
# https://github.com/evilsocket/pwnagotchi/issues/483
@ -23,7 +24,7 @@ def install_file(source_filename, dest_filename):
if not os.path.isdir(dest_folder):
os.makedirs(dest_folder)
shutil.copyfile(source_filename, dest_filename)
shutil.copy2(source_filename, dest_filename)
if dest_filename.startswith("/usr/bin/"):
os.chmod(dest_filename, 0o755)