Skip to content

Instantly share code, notes, and snippets.

@koter84
Created April 18, 2017 15:56
Show Gist options
  • Save koter84/1020861dfb5c6e1f79d235824f6fbe5e to your computer and use it in GitHub Desktop.
Save koter84/1020861dfb5c6e1f79d235824f6fbe5e to your computer and use it in GitHub Desktop.
easyscreencast gnome extension
#!/bin/bash
# check version
prog_dir_version=$(grep \"version\" ~/.local/share/gnome-shell/extensions/[email protected]/metadata.json | awk '{ print $2 }' | sed s/,//g)
echo "DIR Version: $prog_dir_version"
prog_url="https://raw.githubusercontent.com/EasyScreenCast/EasyScreenCast/master/metadata.json"
prog_url_version=$(curl -s $prog_url | grep \"version\" | awk '{ print $2 }' | sed s/,//g)
echo "URL Version: $prog_url_version"
# check that a current version is found
if [ "$prog_dir_version" == "" ]
then
echo "New Installation! (no old version found)"
new_install="1"
fi
# check that a new version and url are found
if [ "$prog_url" == "" ] || [ "$prog_url_version" == "" ]
then
echo "couldn't find url for new version"
exit
fi
# check current dir version with current url version
if [ "$prog_dir_version" != "$prog_url_version" ]
then
if [ "$new_install" != "1" ]
then
echo "New Version Found!"
fi
if [ -d /tmp/easyscreencast ]
then
rm -rf /tmp/easyscreencast
fi
mkdir /tmp/easyscreencast
cd /tmp/easyscreencast/
git clone https://github.com/EasyScreenCast/EasyScreenCast
if [ "$new_install" != "1" ]
then
rm -r ~/.local/share/gnome-shell/extensions/[email protected]
fi
mv EasyScreenCast ~/.local/share/gnome-shell/extensions/[email protected]
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment