Browse Source

first commit

grigruss 1 year ago
commit
79b952d444
4 changed files with 68 additions and 0 deletions
  1. 18 0
      README.md
  2. 34 0
      ssupdate
  3. 3 0
      supd
  4. 13 0
      upd.desktop

File diff suppressed because it is too large
+ 18 - 0
README.md


+ 34 - 0
ssupdate

@@ -0,0 +1,34 @@
+#!/bin/bash
+#sudo pacman-mirrors -f 0
+MIRR='https://mirror.yandex.ru/mirrors/manjaro/stable'
+STATE=$(mktemp /tmp/state.XXXXXXX)
+if [[ ! -d ~/.local/share/supd ]]
+then
+	mkdir ~/.local/share/supd
+fi
+wget "$MIRR/state" -O "$STATE" 
+D=$(< "$STATE" grep -i 'date=')
+DD=$(date +%s --date="${D//date=/}")
+if [[ -f ~/.local/share/supd/state ]]
+then
+	ND=$(cat ~/.local/share/supd/state)
+else
+	ND=$(date +%s --date="2000-01-01")
+	echo "$ND" >~/.local/share/supd/state
+fi
+if (( DD > ND ))
+then
+	echo -e "Обновление от $D\nОбновим?"
+	read -rn 1 Q
+	if [[ "$Q" == "y" ]]
+	then
+		echo "Обновляем..."
+		sudo pacman -Syyu && echo "$DD" >~/.local/share/supd/state
+		yay
+	else
+		echo "Обновление отложено."
+	fi
+else
+	echo "Нет обновлений на зеркале $MIRR."
+fi
+rm "$STATE"

+ 3 - 0
supd

@@ -0,0 +1,3 @@
+#!/bin/bash
+sleep 30
+xfce4-terminal -x ~/bin/ssupdate

+ 13 - 0
upd.desktop

@@ -0,0 +1,13 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=0.9.4
+Type=Application
+Name=UPD
+Comment=Автопредложка обновлений
+Exec=/home/grigruss/bin/supd
+OnlyShowIn=XFCE;
+RunHook=0
+StartupNotify=false
+Terminal=false
+Hidden=false
+