/raspberry-pi-usb-cloner

raspberry pi usb-cake replicator

Primary LanguagePythonGNU General Public License v2.0GPL-2.0

raspberry pi usb-cake replicator

sponsor

This project was made possible by the people at Tweaklab.

installation

simple

  • ssh onto your raspberry
  • git clone https://github.com/faebser/raspberry-pi-usb-cloner.git
  • install dcfldd
  • make sure that cloner.py and usb.sh are set executable (chmod +x )
  • sudo python cloner.py to run the app
  • navigate your browser to the ip of your raspi, the default port is 8080

run on startup

  • ssh into your raspberry
  • git clone https://github.com/faebser/raspberry-pi-usb-cloner.git
  • make sure that cloner.py and usb.sh are set executable (chmod +x )
  • in the home directory create a file run.sh with the following content
#!/bin/bash

for pid in $(pidof -x python cloner.py); do
        if [ $pid != $$ ]; then
                echo "[$(date)] : Cloner : Process is already running with PID $pid"
                exit 1
        fi
done

echo "starting cloner"

cd /DIR/TO/CLONER

while true
do
sh -c "python cloner.py"
sleep 3
done
  • edit your ~/.bashrc and add ./run.sh
  • reboot

run cloner on port 80

  • remove apache with sudo apt-get remove apache2
  • change the line
run(host='0.0.0.0', port=8080, reloader=False)

in cloner.py to

run(host='0.0.0.0', port=80, reloader=False)
  • follow the instructions above

usage

  • point your browser to the configured ip and port of your raspberry (eg: 192.169.1.23:8080)
  • select the source/master
  • press the clone button and clone away