Merge pull request #613 from roramirez/pm2_start

Pm2 start
This commit is contained in:
Michael Teeuw
2017-01-12 19:39:03 +01:00
committed by GitHub
4 changed files with 20 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Added
- Add loaded function to modules, providing an async callback.
- Add use pm2 for manager process into Installer RaspberryPi script
### Fixed
- Update .gitignore to not ignore default modules folder.

2
installers/mm.sh Executable file
View File

@@ -0,0 +1,2 @@
cd ~/MagicMirror
DISPLAY=:0 npm start

View File

@@ -0,0 +1,7 @@
{
apps : [{
name : "MagicMirror",
script : "/home/pi/MagicMirror/installer/mm.sh",
watch : ["/home/pi/MagicMirror/config/config.js"]
}]
}

View File

@@ -148,6 +148,16 @@ else
echo -e "\e[93mplymouth is not installed.\e[0m";
fi
# Use pm2 control like a service MagicMirror
read -p "Do you want use pm2 for auto starting of your MagicMirror (y/n)?" choice
if [[ $choice =~ ^[Yy]$ ]]
then
sudo npm install -g pm2
sudo su -c "env PATH=$PATH:/usr/bin pm2 startup linux -u pi --hp /home/pi"
pm2 start ~/MagicMirror/installers/pm2_MagicMirror.json
pm2 save
fi
echo " "
echo -e "\e[92mWe're ready! Run \e[1m\e[97mDISPLAY=:0 npm start\e[0m\e[92m from the ~/MagicMirror directory to start your MagicMirror.\e[0m"
echo " "