66 lines
1.3 KiB
Bash
66 lines
1.3 KiB
Bash
#!/bin/bash
|
|
|
|
#update sytem
|
|
sudo apt-get -y update
|
|
sudo apt-get -y upgrade
|
|
|
|
#enable and start ssh
|
|
sudo systemctl enable ssh
|
|
sudo systemctl start ssh
|
|
|
|
#install remote desktop
|
|
sudo apt-get -y install xrdp
|
|
|
|
#install nodejs
|
|
sudo apt-get -y install nodejs
|
|
|
|
#install npm
|
|
sudo apt-get -y install npm
|
|
|
|
#install firefox
|
|
sudo apt-get -y install firefox-esr
|
|
|
|
cd `dirname $0`
|
|
echo "`dirname $0`"
|
|
#get correct node modules
|
|
|
|
rm -rf node_modules
|
|
npm install express
|
|
npm install bcrypt
|
|
npm install nedb
|
|
npm install express-session
|
|
npm install nedb-session-store
|
|
|
|
|
|
#add server.start to autostart if not found
|
|
find="`grep server.start /etc/rc.local`"
|
|
if [ "$find" = "" ]
|
|
then
|
|
echo "adding server startup to /etc/rc.local"
|
|
cp /etc/rc.local "`pwd`"
|
|
sed -i '$d' rc.local
|
|
echo "`pwd`/server.start" >> rc.local
|
|
echo "exit 0" >> rc.local
|
|
sudo mv rc.local /etc/rc.local
|
|
else
|
|
echo "server startup already in /etc/rc.local"
|
|
fi
|
|
|
|
#add firefox start in kiosk mode after logged in
|
|
find="`grep firefox ~/.profile`"
|
|
if [ "$find" = "" ]
|
|
then
|
|
echo "adding firefox start to ~/.profile"
|
|
echo "firefox --kiosk http://localhost:8080/info &" >> ~/.profile
|
|
else
|
|
echo "firefox start already found in ~/.profile"
|
|
fi
|
|
|
|
sudo chmod +x server.start
|
|
|
|
echo "network/mac adress:`hostname -I`"
|
|
|
|
#system restart
|
|
echo "System will restart in 10s. ^C to cancel"
|
|
sleep 10
|
|
sudo reboot -h now |