diff --git a/CHANGELOG.md b/CHANGELOG.md index 65119703..183196cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,10 +10,13 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Added - Add loaded function to modules, providing an async callback. - Made default newsfeed module aware of gesture events from [MMM-Gestures](https://github.com/thobach/MMM-Gestures) +- Add use pm2 for manager process into Installer RaspberryPi script + ### Fixed - Update .gitignore to not ignore default modules folder. - Remove white flash on boot up. +- Added `update` in Raspberry Pi installation script. ## [2.1.0] - 2016-12-31 diff --git a/installers/mm.sh b/installers/mm.sh new file mode 100755 index 00000000..cc6c4bb3 --- /dev/null +++ b/installers/mm.sh @@ -0,0 +1,2 @@ +cd ~/MagicMirror +DISPLAY=:0 npm start diff --git a/installers/pm2_MagicMirror.json b/installers/pm2_MagicMirror.json new file mode 100644 index 00000000..55f8df31 --- /dev/null +++ b/installers/pm2_MagicMirror.json @@ -0,0 +1,7 @@ +{ + apps : [{ + name : "MagicMirror", + script : "/home/pi/MagicMirror/installer/mm.sh", + watch : ["/home/pi/MagicMirror/config/config.js"] + }] +} diff --git a/installers/raspberry.sh b/installers/raspberry.sh index b970d02e..718f78b6 100644 --- a/installers/raspberry.sh +++ b/installers/raspberry.sh @@ -36,6 +36,10 @@ fi function version_gt() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; } function command_exists () { type "$1" &> /dev/null ;} +# Update before first apt-get +echo -e "\e[96mUpdating packages ...\e[90m" +sudo apt-get update || echo -e "\e[91mUpdate failed, carrying on installation ...\e[90m" + # Installing helper tools echo -e "\e[96mInstalling helper tools ...\e[90m" sudo apt-get install curl wget git build-essential unzip || exit @@ -144,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 " " diff --git a/translations/pl.json b/translations/pl.json index 7a47745b..06bf3b5c 100644 --- a/translations/pl.json +++ b/translations/pl.json @@ -24,10 +24,10 @@ "W": "W", "WNW": "WNW", "NW": "NW", - "NNW": "NNW" - + "NNW": "NNW", + /* UPDATE INFO */ "UPDATE_NOTIFICATION": "Dostępna jest aktualizacja MagicMirror².", "UPDATE_NOTIFICATION_MODULE": "Dostępna jest aktualizacja modułu MODULE_NAME.", - "UPDATE_INFO": "The current installation is COMMIT_COUNT behind on the BRANCH_NAME branch." + "UPDATE_INFO": "Zainstalowana wersja odbiega o COMMIT_COUNT commitów od gałęzi BRANCH_NAME." }