This commit is contained in:
Your Name
2025-02-25 11:55:44 +01:00
parent e3607143a1
commit 144d904813
5 changed files with 40 additions and 4 deletions

View File

@@ -68,4 +68,27 @@ echo "Set Up Apache"
sudo sed -i 's|DocumentRoot /var/www/html|DocumentRoot /var/www/nebuleair_pro_4g|' /etc/apache2/sites-available/000-default.conf
sudo systemctl reload apache2
#add sudo authorization
if ! sudo grep -q "/usr/bin/nmcli" /etc/sudoers; then
echo "Setting up sudo authorization..."
echo -e "ALL ALL=(ALL) NOPASSWD: /usr/bin/nmcli, /usr/sbin/reboot\nwww-data ALL=(ALL) NOPASSWD: /usr/bin/git pull\nwww-data ALL=(ALL) NOPASSWD: /usr/bin/ssh\nwww-data ALL=(ALL) NOPASSWD: /usr/bin/python3 *" | sudo EDITOR="tee -a" visudo
else
echo "Sudo authorization already set. Skipping..."
fi
#Open all serial ports
if ! grep -q "enable_uart=1" /boot/firmware/config.txt; then
echo "Adding UART configuration..."
echo -e "\nenable_uart=1\ndtoverlay=uart0\ndtoverlay=uart1\ndtoverlay=uart2\ndtoverlay=uart3\ndtoverlay=uart4\ndtoverlay=uart5" | sudo tee -a /boot/firmware/config.txt > /dev/null
else
echo "UART configuration already set. Skipping..."
fi
sudo chmod 777 /dev/ttyAMA*
#Open I2C ports
echo "Open I2C ports"
sudo raspi-config nonint do_i2c 0
echo "Setup completed successfully!"