From cf76bdcb44e72c085cf46bc5e26be2d62c9eee85 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 13 Jan 2022 21:48:04 +0100 Subject: [PATCH] Updated configuration for automatic install --- README.md | 3 ++- rc.local | 59 ++++++++++++++++++++++++++++++--------------- rc.local.new | 25 +++++++++++++++++++ wpa_supplicant.conf | 8 ++++++ 4 files changed, 75 insertions(+), 20 deletions(-) mode change 100644 => 100755 rc.local create mode 100755 rc.local.new create mode 100644 wpa_supplicant.conf diff --git a/README.md b/README.md index 1933ac9..f5ce69f 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ This project prints all SSIDs, MAC addresses, and their vendors on a thermal pri ## Tips For a headless install you need to * Enable SSH: ``touch /boot/ssh`` -* Configure Wi-Fi: Create file ``/boot/wpa_supplicant.conf`` +* Configure Wi-Fi: Create file ``/boot/wpa_supplicant.conf``. This repository contains a configuration file for Freifunk. country=DE ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev @@ -36,3 +36,4 @@ For a headless install you need to psk="NETWORK-PASSWORD" } + diff --git a/rc.local b/rc.local old mode 100644 new mode 100755 index 6fdabbe..63a2b3d --- a/rc.local +++ b/rc.local @@ -1,25 +1,46 @@ -#!/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. +#!/bin/bash -# Print the IP address -_IP=$(hostname -I) || true -if [ "$_IP" ]; then - printf "My IP address is %s\n" "$_IP" +######################################################## +# Installation Script for CMS Plugin for Trackerjacker # +######################################################## + +# Check if root +if [ "$EUID" -ne 0 ] + then echo "Please run as root" + exit fi -# Run trackerjacker with cms plugin in background -trackerjacker -i wlan0 --trigger-plugin cms --track & +# Update OS +apt-get update +apt-get dist-upgrade --yes +# Install Python3 and additional stuff +apt-get install git python3-pip libopenjp2-7-dev python3-serial python3-pil --yes -exit 0 +# Remove old trackerjacker +pip3 uninstall -y trackerjacker + +# Fix bug in current ubuntu +ln -s -f /usr/lib/arm-linux-gnueabihf/libc.a /usr/lib/arm-linux-gnueabihf/liblibc.a + +# Get trackerjacker, add plugin and install it +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 + +pip3 install escpos + +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 -f wifi-printer/rc.local.new /etc/rc.local +chmod +x /etc/rc.local + +reboot diff --git a/rc.local.new b/rc.local.new new file mode 100755 index 0000000..6fdabbe --- /dev/null +++ b/rc.local.new @@ -0,0 +1,25 @@ +#!/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. + +# 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 diff --git a/wpa_supplicant.conf b/wpa_supplicant.conf new file mode 100644 index 0000000..e904311 --- /dev/null +++ b/wpa_supplicant.conf @@ -0,0 +1,8 @@ + country=DE + ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev + update_config=1 + + network={ + ssid="Freifunk" + key_mgmt=NONE + }