added installation script, basic script structure and first requirements.
Signed-off-by: Ebbe Baß <ebbe.bass>main
parent
ac3b667100
commit
eff8cdc0fb
|
@ -0,0 +1,19 @@
|
|||
import os
|
||||
import time
|
||||
import sys
|
||||
import sqlite3
|
||||
import python_artnet as Artnet
|
||||
import DMXEnttecPro
|
||||
import sacn
|
||||
import flask
|
||||
|
||||
|
||||
|
||||
webapp = flask.Flask(__name__)
|
||||
|
||||
@webapp.route("/")
|
||||
def index():
|
||||
return "Hello world!"
|
||||
|
||||
if __name__ == "__main__":
|
||||
webapp.run(host="0.0.0.0", port=80)
|
|
@ -0,0 +1,134 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Check for sudo rights
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
echo "Please run as root or using sudo"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Function to display usage
|
||||
usage() {
|
||||
echo "Usage: sudo $0 [--install|--configure]"
|
||||
}
|
||||
|
||||
# Function to configure IP for eth0 interface
|
||||
configure_eth0_ip() {
|
||||
read -p "Enter IP address: " ip_address
|
||||
read -p "Enter netmask: " netmask
|
||||
read -p "Enter gateway: " gateway
|
||||
read -p "Enter DNS server: " dns
|
||||
cat <<EOF >> /etc/dhcpcd.conf
|
||||
interface eth0
|
||||
static ip_address=$ip_address/$netmask
|
||||
static routers=$gateway
|
||||
static domain_name_servers=$dns
|
||||
EOF
|
||||
echo "Static IP configuration for eth0 complete."
|
||||
}
|
||||
|
||||
# Function to configure eth0 interface for DHCP
|
||||
configure_eth0_dhcp() {
|
||||
sed -i '/^interface eth0/d' /etc/dhcpcd.conf
|
||||
systemctl enable --now dhcpcd.service
|
||||
echo "DHCP configuration for eth0 complete."
|
||||
}
|
||||
|
||||
# Function to configure hostname and update instance name
|
||||
configure_hostname() {
|
||||
read -p "Enter a number for the new hostname (e.g., 123): " number
|
||||
if ! [[ "$number" =~ ^[0-9]+$ ]]; then
|
||||
echo "Error: Please enter a valid number."
|
||||
exit 1
|
||||
fi
|
||||
hostname="SchmarkusNode-$number"
|
||||
hostnamectl set-hostname "$hostname"
|
||||
sed -i "s/instance-name = .*/instance-name = $hostname/" /etc/ola/ola-server.conf
|
||||
# Update long_name and short_name in ola-artnet.conf
|
||||
sed -i "s/long_name = OLA - ArtNet node/long_name = $hostname/" /etc/ola/ola-artnet.conf
|
||||
sed -i "s/short_name = OLA - ArtNet node/short_name = $hostname/" /etc/ola/ola-artnet.conf
|
||||
echo "Hostname configuration complete."
|
||||
}
|
||||
|
||||
# Disable OLA modules
|
||||
disable_ola_modules() {
|
||||
local files=(
|
||||
"/etc/ola/ola-espnet.conf"
|
||||
"/etc/ola/ola-opendmx.conf"
|
||||
"/etc/ola/ola-gpio.conf"
|
||||
"/etc/ola/ola-karate.conf"
|
||||
"/etc/ola/ola-kinet.conf"
|
||||
"/etc/ola/ola-milinst.conf"
|
||||
"/etc/ola/ola-osc.conf"
|
||||
"/etc/ola/ola-openpixelcontrol.conf"
|
||||
"/etc/ola/ola-pathport.conf"
|
||||
"/etc/ola/ola-renard.conf"
|
||||
"/etc/ola/ola-spi.conf"
|
||||
"/etc/ola/ola-sandnet.conf"
|
||||
"/etc/ola/ola-usbserial.conf"
|
||||
"/etc/ola/ola-shownet.conf"
|
||||
"/etc/ola/ola-stageprofi.conf"
|
||||
"/etc/ola/ola-usbdmx.conf"
|
||||
)
|
||||
for file in "${files[@]}"; do
|
||||
sed -i 's/enabled = true/enabled = false/' "$file"
|
||||
done
|
||||
}
|
||||
|
||||
disable_ola_modules() {
|
||||
local files=(
|
||||
"/etc/ola/ola-ftdidmx.conf"
|
||||
)
|
||||
for file in "${files[@]}"; do
|
||||
sed -i 's/enabled = false/enabled = true/' "$file"
|
||||
done
|
||||
}
|
||||
|
||||
# Check for arguments
|
||||
if [ "$1" == "--install" ]; then
|
||||
# Installation section
|
||||
apt update && apt upgrade -y
|
||||
apt install -y ola neofetch
|
||||
echo -e "neofetch --ascii \"*@***/..,,.(%*//(#/*/,(#/*/**., .&///**,\n,,,,*.,,,*((//////(((////*/**//*,,,,,,,.\n.,...**(/*//((##%&%%%%%%%%%(**(((/*,,,..\n,**,/(*/###%%%&&&&&&&&&&&%%%%%//(/***..,\n,*/**#####%%%&&&&&@@&&&&&%%%%%%(((//*...\n*,**((####%%%&&&&&&@&&&&&&&%%%%%##//*#%/\n,,,*/((####%%%&&&&&&&&&&&&&%%%%###/**,..\n,.,,*/((###%%%%%&&&&&&&&&&&&%%##((/*/,,,\n.,,,,**(###%%%%%%%&%%%%%&%&%%%%###/**%%.\n&*..*//((((//*///(##(/*,,,,*/(/###,/(#//\n,,,.,**,.****,*,,*#&#***,,,.**/((##//(%(\n,,*./,**,/((###/*/#&%,(//((((/#%%##(%#%/\n.,**,**/*/(/((((,/#&&%/%%&&&&&#%##*##%%.\n/%/**,*(((%%%(/*///#%%%%(/(##%%##(###/,*\n.,,***,**/(((/**//#%%%####((**/(((.,,,./\n,. .,,,,***//,.,,**/((#(*/#((((,.... \n ,****,. ,,,*/(/**((##(#((((,... .\n. ,****///((/(((####%##(((/. .\n.. .. .,,*/(#/(####%%%%%#(/*##,... \n.. .. ,,,,.,//(###(###(/**(### ..\n\"" >> /etc/profile
|
||||
adduser olad spi
|
||||
adduser node olad
|
||||
configure_hostname
|
||||
disable_ola_modules
|
||||
service olad restart
|
||||
echo "Installation complete. Please reboot for changes to take effect."
|
||||
elif [ "$1" == "--configure" ]; then
|
||||
# Configuration section
|
||||
PS3="Select configuration option: "
|
||||
select option in "IP configuration" "Hostname"; do
|
||||
case $option in
|
||||
"IP configuration")
|
||||
PS3="Select IP configuration option for eth0: "
|
||||
select ip_option in "Static IP" "DHCP"; do
|
||||
case $ip_option in
|
||||
"Static IP")
|
||||
configure_eth0_ip
|
||||
break
|
||||
;;
|
||||
"DHCP")
|
||||
configure_eth0_dhcp
|
||||
break
|
||||
;;
|
||||
*)
|
||||
echo "Invalid option. Please select again."
|
||||
;;
|
||||
esac
|
||||
done
|
||||
break
|
||||
;;
|
||||
"Hostname")
|
||||
configure_hostname
|
||||
break
|
||||
;;
|
||||
*)
|
||||
echo "Invalid option. Please select again."
|
||||
;;
|
||||
esac
|
||||
done
|
||||
else
|
||||
usage
|
||||
exit 1
|
||||
fi
|
|
@ -0,0 +1,3 @@
|
|||
DMXEnttecPro==0.4
|
||||
python_artnet==1.0.0
|
||||
sacn==1.9.0
|
Loading…
Reference in New Issue