diff --git a/doc/installPi.sh b/doc/installPi.sh index bdb960b..9755306 100644 --- a/doc/installPi.sh +++ b/doc/installPi.sh @@ -9,8 +9,8 @@ echo "Updating indexes" apt update 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 git gcc g++ make cmake chromium-browser unclutter crontab -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 iptables cron -y || exit echo "Try to uninstall node and npm... (Can fail)" apt purge node -y || true apt purge npm -y || true @@ -67,25 +67,26 @@ EOT DIR="/home/itender/itender/" if [ -d "$DIR" ]; then # Take action if $DIR exists. # - cd "$DIR" + cd "$DIR" || exit echo "Updating..." git pull else 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 - cd "$DIR" - yarn install fi -cd "$DIR" +cd "$DIR" || exit +yarn install echo "Compiling..." yarn run compile echo "Updating 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 -crontab /tmp/currentCron +sudo -u itender crontab /tmp/currentCron echo "Backing up /boot/config.txt to /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 fi +chown itender:itender -R /home/itender/ + reboot now