added slack-updates script. All files in bin/ are now 644
[my-dotfiles.git] / bin / slack-updates
CommitLineData
252ef34a 1#!/bin/bash
2CL="https://mirrors.slackware.com/slackware/slackware64-current/ChangeLog.txt"
3LOCAL_CL="/var/lib/slackpkg/ChangeLog.txt"
4TMP="/tmp"
5TMPCL="${TMP}/ChangeLog.txt"
6
7
8function SHOW_TOOLTIP () {
9 sed '/+--------------------------+/Q' $TMPCL |qarma --width=600 --height=400 --text-info
10}
11
12
13if [[ -f ${TMPCL} ]]; then
14 rm $TMPCL
15fi
16 wget -q -P ${TMP} ${CL}
17 if [ $? -ne 0 ]; then
18 echo " 󱧖  "
19 fi
20NCL=$(head -n 1 ${TMPCL})
21LCL=$(head -n 1 ${LOCAL_CL})
22
23if [[ ${NCL} != ${LCL} ]];then
24 echo " 󰏗 󰚰 "
25else
26 echo " 󰏗  "
27fi
28
29if [ $1 ]; then
30 case $1 in
31 -n )
32 SHOW_TOOLTIP
33 ;;
34 esac
35fi