Skip to content

Instantly share code, notes, and snippets.

@M3kH
Created Oct 11, 2015
Embed
What would you like to do?
Momo updater
#!/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