Updating installer

Took 37 minutes
This commit is contained in:
Tobias Hopp 2022-11-30 23:30:07 +01:00
parent 7d9dfca62e
commit 1e66959956

View File

@ -9,8 +9,8 @@ echo "Updating indexes"
apt update apt update
echo "Installing xserver xinit openbox ufw xserver-xorg x11 unclutter make chromium-browser crontab cmake g++ gcc and git..." echo "Installing xserver xinit openbox ufw xserver-xorg x11 unclutter make chromium-browser crontab cmake g++ gcc and git..."
apt install --no-install-recommends ufw xserver-xorg x11-xserver-utils xinit openbox -y apt install --no-install-recommends ufw xserver-xorg x11-xserver-utils xinit openbox -y || exit
apt install git gcc g++ make cmake chromium-browser unclutter crontab -y apt install git gcc g++ make cmake chromium-browser unclutter iptables cron -y || exit
echo "Try to uninstall node and npm... (Can fail)" echo "Try to uninstall node and npm... (Can fail)"
apt purge node -y || true apt purge node -y || true
apt purge npm -y || true apt purge npm -y || true
@ -67,25 +67,26 @@ EOT
DIR="/home/itender/itender/" DIR="/home/itender/itender/"
if [ -d "$DIR" ]; then if [ -d "$DIR" ]; then
# Take action if $DIR exists. # # Take action if $DIR exists. #
cd "$DIR" cd "$DIR" || exit
echo "Updating..." echo "Updating..."
git pull git pull
else else
echo "Cloning..." echo "Cloning..."
sudo git config --global credential.helper store sudo git config --global credential.helper store || exit
git clone "https://tobiash:!IwedwrimmVeudiweN!@git.gaminggeneration.de/tobiash/itender.git" --quiet git clone "https://tobiash:!IwedwrimmVeudiweN!@git.gaminggeneration.de/tobiash/itender.git" --quiet
cd "$DIR"
yarn install
fi fi
cd "$DIR" cd "$DIR" || exit
yarn install
echo "Compiling..." echo "Compiling..."
yarn run compile yarn run compile
echo "Updating Cron..." echo "Updating Cron..."
# Add line to cron # Add line to cron
echo "@reboot /usr/bin/yarn run start &" >/tmp/currentCron echo "@reboot sudo chmod g+rw /dev/tty?" > /tmp/currentCron
echo "@reboot /usr/bin/yarn run start &" >> /tmp/currentCron
chown itender:itender /tmp/currentCron
#install new cron file #install new cron file
crontab /tmp/currentCron sudo -u itender crontab /tmp/currentCron
echo "Backing up /boot/config.txt to /root/config.txt.bak" echo "Backing up /boot/config.txt to /root/config.txt.bak"
cp /boot/config.txt /root/config.txt.bak cp /boot/config.txt /root/config.txt.bak
@ -115,4 +116,6 @@ if ! grep -w "logo.nologo" /boot/cmdline.txt; then
#cp /tmp/cmdline.txt /boot/cmdline.txt #cp /tmp/cmdline.txt /boot/cmdline.txt
fi fi
chown itender:itender -R /home/itender/
reboot now reboot now