Updated configuration for automatic install

This commit is contained in:
Sebastian 2022-01-13 21:48:04 +01:00
parent e3447e6675
commit cf76bdcb44
4 changed files with 75 additions and 20 deletions

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"
}

59
rc.local Normal file → Executable file
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.
#!/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

25
rc.local.new Executable file
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
wpa_supplicant.conf Normal file
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
}