Changes in printer output and configuration

This commit is contained in:
Sebastian 2022-01-12 23:12:05 +01:00
parent d8c49185e0
commit 07ab300538
3 changed files with 29 additions and 7 deletions

2
cms.py
View File

@ -67,7 +67,7 @@ class Trigger:
.format(dev_id, vendor, vendor, self.manufacturer_to_count[vendor])) .format(dev_id, vendor, vendor, self.manufacturer_to_count[vendor]))
# Output on printer # Output on printer
self.p.text('Ger\20\204\04t: {}\nHersteller: {}\n\n'.format(dev_id, vendor)) self.p.text('Adresse: {}\n{}\n\n'.format(dev_id, vendor))
# Print each n packets a summary # Print each n packets a summary

View File

@ -29,7 +29,6 @@ cd /tmp
git clone https://github.com/calebmadrigal/trackerjacker.git git clone https://github.com/calebmadrigal/trackerjacker.git
git clone https://git.chaospott.de/sirgoofy/wifi-printer.git git clone https://git.chaospott.de/sirgoofy/wifi-printer.git
cp wifi-printer/cms.py trackerjacker/trackerjacker/plugins cp wifi-printer/cms.py trackerjacker/trackerjacker/plugins
cp wifi-printer/*.png trackerjacker/trackerjacker/plugins
pip3 install escpos pip3 install escpos
@ -37,9 +36,11 @@ cd trackerjacker
python3 setup.py build python3 setup.py build
python3 setup.py install python3 setup.py install
# Copy image files to installed plugin because this is not done automatically
cp wifi-printer/*.png /usr/local/lib/python3.9/dist-packages/trackerjacker-1.9.0-py3.9.egg/trackerjacker/plugins/
# Automatically start trackerjacker on startup # Automatically start trackerjacker on startup
cp wifi-printer/trackerjacker.sh /etc/rc.local/ cp -f wifi-printer/trackerjacker.sh /etc/rc.local
chmod +x /etc/rc.local/trackerjacker.sh chmod +x /etc/rc.local
reboot reboot

View File

@ -1,4 +1,25 @@
#!/bin/bash #!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Run trackerjacker with cms plugin # Print the IP address
trackerjacker -i wlan1 --trigger-plugin cms --track _IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
# Run trackerjacker with cms plugin in background
trackerjacker -i wlan0 --trigger-plugin cms --track &
exit 0