diff --git a/cms.py b/cms.py index 65a8688..fa232aa 100644 --- a/cms.py +++ b/cms.py @@ -67,7 +67,7 @@ class Trigger: .format(dev_id, vendor, vendor, self.manufacturer_to_count[vendor])) # 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 diff --git a/install.sh b/install.sh index 4665572..aaa8e95 100644 --- a/install.sh +++ b/install.sh @@ -29,7 +29,6 @@ cd /tmp git clone https://github.com/calebmadrigal/trackerjacker.git git clone https://git.chaospott.de/sirgoofy/wifi-printer.git cp wifi-printer/cms.py trackerjacker/trackerjacker/plugins -cp wifi-printer/*.png trackerjacker/trackerjacker/plugins pip3 install escpos @@ -37,9 +36,11 @@ cd trackerjacker python3 setup.py build 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 -cp wifi-printer/trackerjacker.sh /etc/rc.local/ -chmod +x /etc/rc.local/trackerjacker.sh +cp -f wifi-printer/trackerjacker.sh /etc/rc.local +chmod +x /etc/rc.local reboot diff --git a/rc.local b/rc.local index 7a160ed..6fdabbe 100644 --- a/rc.local +++ b/rc.local @@ -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 -trackerjacker -i wlan1 --trigger-plugin cms --track +# Print the IP address +_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