Created
October 11, 2015 21:41
-
-
Save M3kH/c16f506176f1f32732ae to your computer and use it in GitHub Desktop.
Momo updater
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
LATEST=$(curl https://api.github.com/repos/m3kh/momo/commits | underscore extract '0.sha' | sed s/[^a-zA-Z0-9\_]//g); | |
CURRENT=$(cat /home/pi/.momo_version | sed s/[^a-zA-Z0-9\_]//g); | |
echo "${LATEST}"; | |
echo "${CURRENT}"; | |
if [ "$LATEST" = "$CURRENT" ]; then | |
echo "Momo is uptodate"; | |
else | |
rm /home/pi/.momo_version; | |
echo $LATEST >> /home/pi/.momo_version; | |
cd /home/pi | |
wget https://github.com/M3kH/momo/archive/master.zip; | |
mv master.zip momo.zip; | |
rm -rf /home/pi/momo-master; | |
unzip "/home/pi/momo.zip"; | |
cd /home/pi/momo-master/; | |
chmod +755 -R /home/pi/momo-master/public; | |
sudo npm install; | |
echo "Momo Updated"; | |
rm "/home/pi/momo.zip"; | |
fi | |
cd /home/pi/momo-master/; | |
sudo npm start; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment