Took 2 hours 2 minutes
This commit is contained in:
2023-02-01 13:07:41 +01:00
parent 3d58d934e7
commit 564c3f78c0
7 changed files with 123 additions and 23 deletions

View File

@ -7,6 +7,9 @@ fi
echo "Creating user if not exists"
useradd -p $(openssl passwd -1 iTender2022) itender || true
mkdir /home/itender/
usermod -d /home/itender/ itender || true
chown itender:itender /home/itender
echo "Updating indexes"
apt update
@ -52,6 +55,10 @@ echo "Installing mongodb and yarn..."
apt install nodejs yarn mongodb-org -y
apt upgrade -y
adduser itender gpio
adduser itender sudo
chown itender:itender /home/itender/ -R
# V2: Arduino CLI
echo "Installing arduino-cli..."
sudo -u itender mkdir -p /home/itender/bin
@ -61,8 +68,6 @@ sudo -u itender /home/itender/bin/arduino-cli core update-index || true
sudo -u itender /home/itender/bin/arduino-cli lib install ArduinoJson || true
sudo -u itender /home/itender/bin/arduino-cli lib install HX711 || true
echo "Installing autostart..."
# Autostart
cat <<EOT >/etc/xdg/openbox/autostart
@ -85,7 +90,6 @@ echo "Installing bashrc"
echo "clear" >>/home/itender/.bashrc
echo "[[ -z \$DISPLAY && \$XDG_VTNR -eq 1 ]] && startx -- -nocursor >/dev/null 2>&1" >>/home/itender/.bashrc
DIR="/home/itender/itender/"
if [ -d "$DIR" ]; then
# Take action if $DIR exists. #
@ -136,7 +140,6 @@ WantedBy=multi-user.target
EOT
#sh -c "git pull --quiet || true"
echo "Activating systemctl daemons..."
systemctl daemon-reload
systemctl enable mongod
@ -176,7 +179,6 @@ if ! grep -w "gpu_freq=700" /boot/config.txt; then
echo "gpu_freq=700" >>/boot/config.txt
fi
echo "Setting no-logo..."
systemctl disable getty@tty1.service
@ -186,19 +188,17 @@ if ! grep -w "logo.nologo" /boot/cmdline.txt; then
sed -i '1 s_$_ loglevel=3 logo.nologo disable\_splash=1 splash quiet plymouth.ignore-serial-consoles logo.nologo vt.global\_cursor_default=0_' /boot/cmdline.txt
#cp /tmp/cmdline.txt /boot/cmdline.txt
sed -i "1 s|$| vt.global_cursor_default=0|" /boot/cmdline.txt
sed -i '1 i\avoid_warnings=1' /boot/config.txt
sed -i 's/console=tty0/console=tty3/' /boot/cmdline.txt
fi
echo "iTender© 2022-2023
echo "iTender© 2022-2023 - Official licensed software
Programmed by Tobias Hopp" >/etc/motd
echo "[Service]
ExecStart=/usr/sbin/dhcpcd -q" >/etc/systemd/system/dhcpcd.service.d/wait.conf
chown itender:itender -R /home/itender/
adduser itender gpio
adduser itender sudo
echo "Installation finished!"