Update installer
Took 46 minutes
This commit is contained in:
parent
b8519e2647
commit
8592d5a3a4
@ -48,22 +48,41 @@ apt update
|
||||
apt install nodejs yarn mongodb-org -y
|
||||
apt upgrade -y
|
||||
|
||||
echo "Activating systemctl daemons..."
|
||||
systemctl daemon-reload
|
||||
systemctl enable mongod
|
||||
|
||||
echo "Installing autostart..."
|
||||
# Autostart
|
||||
cat <<EOT >>/etc/xdg/openbox/autostart
|
||||
cat <<EOT >/etc/xdg/openbox/autostart
|
||||
xset s off
|
||||
xset s noblank
|
||||
xset -dpms
|
||||
|
||||
setxkbmap -option terminate:ctrl_alt_bksp
|
||||
|
||||
/home/itender/start.sh
|
||||
# Start Chromium in kiosk mode
|
||||
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' ~/.config/chromium/'Local State'
|
||||
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/; s/"exit_type":"[^"]\+"/"exit_type":"Normal"/' ~/.config/chromium/Default/Preferences
|
||||
|
||||
/usr/bin/chromium-browser --disable-infobars --kiosk --incognito --disable-pinch --overscroll-history-navigation=0 "http://127.0.0.1:3000/" &
|
||||
EOT
|
||||
|
||||
echo "Installing bashrc"
|
||||
echo "[[ -z \$DISPLAY && \$XDG_VTNR -eq 1 ]] && startx -- -nocursor" >> /home/itender/.bashrc
|
||||
#
|
||||
#echo "Installing start.sh"
|
||||
#cat <<EOT >>/home/itender/start.sh
|
||||
##!/bin/bash
|
||||
#cd /home/itender/ || exit
|
||||
#sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' ~/.config/chromium/'Local State'
|
||||
#sed -i 's/"exited_cleanly":false/"exited_cleanly":true/; s/"exit_type":"[^"]\+"/"exit_type":"Normal"/' ~/.config/chromium/Default/Preferences
|
||||
#
|
||||
#address="localhost"
|
||||
#
|
||||
#echo "Waiting 5 seconds to start chromium..."
|
||||
#sleep 5
|
||||
#/usr/bin/chromium-browser --disable-infobars --kiosk --incognito --disable-pinch --overscroll-history-navigation=0 "http://\${address}:3000/"
|
||||
##/usr/bin/startx /usr/bin/chromium-browser --kiosk --incognito --disable-pinch --overscroll-history-navigation=0 http://192.168.1.186:3000/
|
||||
#EOT
|
||||
#chmod +x /home/itender/start.sh
|
||||
|
||||
DIR="/home/itender/itender/"
|
||||
if [ -d "$DIR" ]; then
|
||||
# Take action if $DIR exists. #
|
||||
@ -83,11 +102,40 @@ yarn run compile
|
||||
echo "Updating Cron..."
|
||||
# Add line to cron
|
||||
echo "@reboot sudo chmod g+rw /dev/tty?" > /tmp/currentCron
|
||||
echo "@reboot /usr/bin/yarn run start &" >> /tmp/currentCron
|
||||
#echo "@reboot cd /home/itender/itender/ && /usr/bin/yarn run start &" >> /tmp/currentCron
|
||||
chown itender:itender /tmp/currentCron
|
||||
#install new cron file
|
||||
sudo -u itender crontab /tmp/currentCron
|
||||
|
||||
echo "Installing systemd service..."
|
||||
cat <<EOT > /etc/systemd/system/itender.service
|
||||
[Unit]
|
||||
Description=iTender App
|
||||
After=network.target mongod.service
|
||||
StartLimitIntervalSec=1
|
||||
StartLimitBurst=1000
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
RestartSec=1s
|
||||
User=itender
|
||||
ExecStartPre=sleep 3
|
||||
WorkingDirectory=/home/itender/itender/
|
||||
ExecStart=/usr/bin/yarn run start
|
||||
StandardOutput=append:/var/log/itender.log
|
||||
StandardError=append:/var/log/itender.log
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
EOT
|
||||
|
||||
echo "Activating systemctl daemons..."
|
||||
systemctl daemon-reload
|
||||
systemctl enable mongod
|
||||
systemctl enable itender
|
||||
|
||||
echo "Backing up /boot/config.txt to /root/config.txt.bak"
|
||||
cp /boot/config.txt /root/config.txt.bak
|
||||
echo "Updating Boot config..."
|
||||
|
Loading…
x
Reference in New Issue
Block a user