update
This commit is contained in:
71
install.sh
Normal file
71
install.sh
Normal file
@ -0,0 +1,71 @@
|
||||
echo "Updating indexes"
|
||||
apt update
|
||||
|
||||
echo "Installing xserver xinit openbox ufw xserver-xorg x11 unclutter make crontab cmake g++ gcc and git..."
|
||||
apt install --no-install-recommends ufw xserver-xorg x11-xserver-utils xinit openbox -y || exit
|
||||
apt install git gcc g++ make cmake unclutter iptables cron pigpio -y || exit
|
||||
echo "Try to uninstall node and npm... (Can fail)"
|
||||
apt purge node -y || true
|
||||
apt purge npm -y || true
|
||||
|
||||
echo "Setup xserver..."
|
||||
# XServer
|
||||
echo "allowed_users=anybody" >/etc/X11/Xwrapper.config
|
||||
#no-uncomment cp autostart.config /etc/xdg/openbox/autostart
|
||||
|
||||
echo "Adding apt keys..."
|
||||
# Keys and stuff ---
|
||||
# Nodejs
|
||||
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash
|
||||
|
||||
# Yarn
|
||||
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
|
||||
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
|
||||
|
||||
echo "Updating indexes..."
|
||||
# Final update
|
||||
apt update
|
||||
echo "Installing mongodb and yarn..."
|
||||
apt install nodejs yarn mongodb-org -y
|
||||
apt upgrade -y
|
||||
|
||||
|
||||
|
||||
echo "Installing autostart..."
|
||||
# Autostart
|
||||
cat <<EOT >/etc/xdg/openbox/autostart
|
||||
xset s off
|
||||
xset s noblank
|
||||
xset -dpms
|
||||
setxkbmap -option terminate:ctrl_alt_bksp
|
||||
|
||||
cd /home/photobox/photobox/
|
||||
./mount.sh
|
||||
yarn run start
|
||||
EOT
|
||||
|
||||
echo "Setting to console autologin..."
|
||||
raspi-config nonint do_boot_behaviour B2
|
||||
|
||||
|
||||
echo "Installing bashrc"
|
||||
echo "clear" >>/home/photobox/.bashrc
|
||||
echo "[[ -z \$DISPLAY && \$XDG_VTNR -eq 1 ]] && startx -- -nocursor >/dev/null 2>&1" >>/home/photobox/.bashrc
|
||||
|
||||
|
||||
echo "Setting no-logo..."
|
||||
systemctl disable getty@tty1.service
|
||||
|
||||
|
||||
if ! grep -w "logo.nologo" /boot/cmdline.txt; then
|
||||
echo "Backing up /boot/cmdline.txt to /root/cmdline.txt.bak"
|
||||
cp /boot/cmdline.txt /root/cmdline.txt.bak
|
||||
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 's/console=tty0/console=tty3/' /boot/cmdline.txt
|
||||
fi
|
||||
|
||||
|
||||
chown photobox:photobox -R /home/photobox/
|
Reference in New Issue
Block a user