summarylogtreecommitdiffstats
path: root/pkg_upgrader.sh
blob: 157c9dbec5dcac8b5322a00d9eca0fd37128d1bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

# #########################################################
# You can use this script as 
# cronjob (or something lika that) 
# to automatically update the app.
#
# DON'T FORGET TO REPLACE `yay` to your favorite AUR helper
# #########################################################
cd $(dirname "$0")

RELEASE_TIMESTAMP=$(curl -sL https://download-installer.cdn.mozilla.net/pub/firefox/nightly/latest-mozilla-central-l10n/ | grep -A2 "firefox-$(cat PKGBUILD  | grep -oP "^_version=\K(.*)"  | awk '{print $1}').ru.linux-$(uname -m).tar.bz2\"" | tail -n1 | cut -f2 -d'>' | cut -f1 -d'<' | date +"%s" -f -)
LOCAL_TIMESTAMP=$(cat ~/.firefox-nightly-ru.release.timestamp || echo 0)

if (("$RELEASE_TIMESTAMP" > "$LOCAL_TIMESTAMP")); then
	yay -S firefox-nightly-ru --noconfirm && echo $RELEASE_TIMESTAMP > ~/.firefox-nightly-ru.release.timestamp
fi