Skip to content

Commit

Permalink
Merge pull request #1814 from sdetweil/newscripts
Browse files Browse the repository at this point in the history
 updates for libc6++ on pi 0, node 10
  • Loading branch information
MichMich authored Dec 28, 2019
2 parents 0e93713 + 272ca1a commit 305b55c
Show file tree
Hide file tree
Showing 7 changed files with 417 additions and 204 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- updated compliments.js to handle newline in text, as textfields to not interpolate contents
- updated raspberry.sh installer script to handle new platform issues, split node/npm, pm2, and screen saver changes
- improve handling for armv6l devices, where electron support has gone away, add optional serveronly config option
- improved run-start.sh to handle for serveronly mode, by choice, or when electron not available
- change electron version

❤️ **Donate:** Enjoying MagicMirror²? [Please consider a donation!](https://magicmirror.builders/donate) With your help we can continue to improve the MagicMirror² core.
Expand Down
32 changes: 27 additions & 5 deletions installers/fixuppm2.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
# Define the tested version of Node.js.
NODE_TESTED="v5.1.0"
NODE_TESTED="v10.1.0"
NPM_TESTED="V6.0.0"
USER=`whoami`
PM2_FILE=pm2_MagicMirror.json
Expand All @@ -22,7 +22,14 @@ if [ -d ~/MagicMirror ]; then
cd - >/dev/null
fi
logfile=$logdir/pm2_setup.log
echo the log will be saved in $logfile
date +"pm2 setup starting - %a %b %e %H:%M:%S %Z %Y" >>$logfile
echo system is $(uname -a) >> $logfile
if [ "$mac" == "Darwin" ]; then
echo the os is macOS $(sw_vers -productVersion) >> $logfile
else
echo the os is $(lsb_release -a 2>/dev/null) >> $logfile
fi
node_installed=$(which node)
if [ "$node_installed." == "." ]; then
# node not installed
Expand Down Expand Up @@ -105,11 +112,26 @@ if [ -d ~/MagicMirror ]; then
fi
fi
fi
echo command = $v >>$logfile
echo startup command = $v >>$logfile
# execute the command returned
$v 2>/dev/null >>$logfile
echo pm2 startup done >>$logfile

$v 2>&1 >>$logfile
echo pm2 startup command done >>$logfile
# is this is mac
# need to fix pm2 startup, only on catalina
if [ $mac == 'Darwin' ]; then
if [ $(sw_vers -productVersion | head -c 6) == '10.15.' ]; then
# only do if the faulty tag is present (pm2 may fix this, before the script is fixed)
if [ $(grep -m 1 UserName /Users/$USER/Library/LaunchAgents/pm2.$USER.plist | wc -l) -eq 1 ]; then
# copy the pm2 startup file config
cp /Users/$USER/Library/LaunchAgents/pm2.$USER.plist .
# edit out the UserName key/value strings
sed -e '/UserName/{N;d;}' pm2.$USER.plist > pm2.$USER.plist.new
# copy the file back
sudo cp pm2.$USER.plist.new /Users/$USER/Library/LaunchAgents/pm2.$USER.plist
fi
fi
fi

# if the user is no pi, we have to fixup the pm2 json file
echo configure the pm2 config file for MagicMirror >>$logfile
if [ "$USER" != "pi" ]; then
Expand Down
Loading

0 comments on commit 305b55c

Please sign in to comment.