From d4911108a7084c4787edd471377622ce06b48ba0 Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Tue, 14 Nov 2023 08:37:14 +0100 Subject: [PATCH 1/3] update Dutch language Signed-off-by: Jeroen Oudshoorn --- pwnagotchi/locale/nl/LC_MESSAGES/voice.po | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pwnagotchi/locale/nl/LC_MESSAGES/voice.po b/pwnagotchi/locale/nl/LC_MESSAGES/voice.po index 7965096d..263b52ee 100644 --- a/pwnagotchi/locale/nl/LC_MESSAGES/voice.po +++ b/pwnagotchi/locale/nl/LC_MESSAGES/voice.po @@ -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" From dbe9a69fd65739ed35ae9afe09f78b618bf94bca Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Tue, 14 Nov 2023 08:37:50 +0100 Subject: [PATCH 2/3] edited script somewhat Signed-off-by: Jeroen Oudshoorn --- scripts/backup.sh | 1 + scripts/macos_connection_share.sh | 2 +- scripts/openbsd_connection_share.sh | 4 +++- scripts/restore.sh | 12 +++++++++--- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/scripts/backup.sh b/scripts/backup.sh index 15aa3d8a..dd3f2349 100755 --- a/scripts/backup.sh +++ b/scripts/backup.sh @@ -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" diff --git a/scripts/macos_connection_share.sh b/scripts/macos_connection_share.sh index d3d8627d..25362e30 100755 --- a/scripts/macos_connection_share.sh +++ b/scripts/macos_connection_share.sh @@ -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" ] diff --git a/scripts/openbsd_connection_share.sh b/scripts/openbsd_connection_share.sh index fd20f44d..07e35354 100644 --- a/scripts/openbsd_connection_share.sh +++ b/scripts/openbsd_connection_share.sh @@ -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 diff --git a/scripts/restore.sh b/scripts/restore.sh index d4fb424b..b805a01a 100755 --- a/scripts/restore.sh +++ b/scripts/restore.sh @@ -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 /" From 9299a6e3649421b7950db6388ed714c26820ee00 Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Tue, 14 Nov 2023 12:40:17 +0100 Subject: [PATCH 3/3] edited setup.py Signed-off-by: Jeroen Oudshoorn --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ab4ca286..77e21689 100644 --- a/setup.py +++ b/setup.py @@ -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)