Skip to content

Instantly share code, notes, and snippets.

@hitesh83
Created October 8, 2020 13:28
Show Gist options
  • Save hitesh83/38925256945e9c7297b814c7e1c876eb to your computer and use it in GitHub Desktop.
Save hitesh83/38925256945e9c7297b814c7e1c876eb to your computer and use it in GitHub Desktop.
pisignage.com server install
#!/bin/bash
echo "Reloading local package database."
sudo apt update
echo "install gnupg for GnuPG key"
sudo apt-get install gnupg
echo "Adding mongo 4.4 pgp key"
wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
echo "getting mongodb-org 4.4 repo"
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
echo "Adding NoteJs 14 Repo in package database"
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
echo "Reloading local package database for node and mongo"
sudo apt-get update
echo "installing 1-Mongo 2-NodeJs 3-OpenSSH server 4-Git 5-IageMagick 6-Ffmpeg"
sudo apt-get install -y mongodb-org nodejs openssh-server git imagemagick ffmpeg
echo "Enabling mongod service"
sudo systemctl enable mongod
echo "Starting mongod service"
sudo systemctl start mongod
echo "going to home directory"
cd ~
echo "getting PiSignage repo from Github"
git clone https://github.com/colloqi/pisignage-server
echo "making media and thumbnails dir in home directory"
mkdir -p media
mkdir -p media/_thumbnails
echo "Entring PiSignage Directory"
cd pisignage-server
echo "installing repo by npm install"
sudo npm install
echo "installing pm2 for nodejs maneger"
sudo npm install pm2 -g
echo "starting server with pm2"
sudo pm2 start server.js
echo "adding pm2 in startup"
sudo pm2 startup
echo "saving pm2 settings for startup"
sudo pm2 save
echo "Doing ip a to get ip for this system, you are advice to set static IP and enable port 3000 in and out "
ip a
echo -e "\e[1;31mRebooting system in 10sec\e[0m"
sleep 10
sudo reboot
@hitesh83
Copy link
Author

hitesh83 commented Oct 8, 2020

https://tinyurl.com/pisignage short url of raw file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment