moved final-setup to setup.sh since it's the main setup now.

This commit is contained in:
K 2024-10-19 18:03:29 +05:30
parent c0bb3861dd
commit 382683efe1
Signed by: notkshitij
GPG Key ID: C5B8BC7530F8F43F

44
setup.sh Normal file
View File

@ -0,0 +1,44 @@
#!/bin/bash
line="=================================="
PROJECT_DIR=/home/$(whoami)/iot-mini
###############################################
# Install dependencies
sudo apt update
# Checking for python and it's dependencies
if ! dpkg -l | grep -q "python3"; then
echo -e "$line\npython3 not installed, installing...\n$line\n"
sudo apt install -y python3
else
echo -e "$line\npython3 already installed. Moving one...\n$line\n"
fi
if ! dpkg -l | grep -q "python3-pip"; then
echo -e "$line\npython3-pip not installed, installing...\n$line\n"
sudo apt install -y python3-pip
else
echo -e "$line\npython3-pip already installed. Moving one...\n$line\n"
fi
if ! dpkg -l | grep -q "python3.11-venv"; then
echo -e "$line\npython3.11-venv not installed, installing...\n$line\n"
sudo apt install -y python3.11-venv
else
echo -e "$line\npython3-venv already installed. Moving one...\n$line\n"
fi
# Install camera stuff
echo -e "$line\nInstalling camera dependencies\n$line"
sudo apt install -y python3-picamera2 python3-picamera python3-opencv python3-numpy # Python camera packages for pi camera
sudo apt install -y libjpeg8-dev libtiff4-dev libjasper-dev libpng12-dev # Image I/O packages
sudo apt install -y libgtk2.0-dev libcap-dev # GTK development library & picamera2 dependency
sudo apt install -y libavcodec-dev libavformat-dev libswscale-dev libv4l-dev # Video I/O packages
sudo apt install -y libatlas-base-dev gfortran # Optimize OpenCV operation
sudo apt install -y python3-requests # For notifications
###############################################
cp main.py $PROJECT_DIR/
cd $PROJECT_DIR