Browse Source

Updated configuration for automatic install

master
Sebastian 1 week ago
parent
commit
cf76bdcb44
4 changed files with 76 additions and 21 deletions
  1. +2
    -1
      README.md
  2. +41
    -20
      rc.local
  3. +25
    -0
      rc.local.new
  4. +8
    -0
      wpa_supplicant.conf

+ 2
- 1
README.md View File

@ -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 <sd-card>/boot/ssh``
* Configure Wi-Fi: Create file ``<sd-card>/boot/wpa_supplicant.conf``
* Configure Wi-Fi: Create file ``<sd-card>/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"
}

+ 41
- 20
rc.local View File

@ -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.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
#!/bin/bash
########################################################
# 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
# 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
exit 0
reboot

+ 25
- 0
rc.local.new View File

@ -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

+ 8
- 0
wpa_supplicant.conf View File

@ -0,0 +1,8 @@
country=DE
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="Freifunk"
key_mgmt=NONE
}

Loading…
Cancel
Save