cosmicpi-rpi_V1.5/install

42 lines
1.1 KiB
Text
Raw Normal View History

2017-10-12 12:17:13 +00:00
#!/bin/bash
2017-10-25 00:07:53 +00:00
echo "--- Getting executable path"
EXECPATH="`dirname \"$0\"`" # relative
EXECPATH="`( cd \"$EXECPATH\" && pwd )`" # absolutized and normalized
if [ -z "$EXECPATH" ] ; then
# error; for some reason, the path is not accessible
# to the script (e.g. permissions re-evaled after suid)
exit 1 # fail
fi
echo "$EXECPATH"
TOREPLACE="PATH_TO_EXECUTABLE"
2017-10-25 18:50:34 +00:00
echo "--- Updating packages"
sudo apt --yes update
sudo apt --yes upgrade
2017-10-25 00:07:53 +00:00
2017-10-25 18:50:34 +00:00
echo "--- Installing packages via apt"
sudo apt --yes install git python-pip htop
echo "--- Installing python packages via pip"
sudo pip install pyserial configparser numpy matplotlib flask flask_googlemaps
2017-10-24 20:55:02 +00:00
echo "we need some more stuff here"
echo "--- Installing create_ap via git"
git clone https://github.com/oblique/create_ap --depth 1
cd create_ap
sudo make install
cd ..
sudo rm -rf create_ap
echo "--- Setting up systemd services"
2017-10-25 00:07:53 +00:00
sed -i -e "s+$TOREPLACE+$EXECPATH+g" install_files/CosmicPi-detector.service
sed -i -e "s+$TOREPLACE+$EXECPATH+g" install_files/CosmicPi-UI.service
sudo cp -f install_files/*.service /etc/systemd/system/
2017-10-24 20:55:02 +00:00
sudo systemctl daemon-reload
2017-10-12 12:17:13 +00:00
echo "--- Finished setup!"