From eb0946cb876c97697897beed69c32a199eac9767 Mon Sep 17 00:00:00 2001 From: Cyrille L Date: Wed, 30 Mar 2022 11:46:16 +0200 Subject: [PATCH] fix: debian list --- usr/local/bin/upd | 2 +- var/lib/upd/scripts/check | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/usr/local/bin/upd b/usr/local/bin/upd index 3ad0928..317748e 100755 --- a/usr/local/bin/upd +++ b/usr/local/bin/upd @@ -1,5 +1,5 @@ #!/bin/bash -# version: 0.0.15 +# version: 0.0.16 # file: upd # Folder: /usr/local/bin # By echolib diff --git a/var/lib/upd/scripts/check b/var/lib/upd/scripts/check index 2daab46..419c9bc 100644 --- a/var/lib/upd/scripts/check +++ b/var/lib/upd/scripts/check @@ -21,6 +21,7 @@ upd__prepare_show # Check for updates if debian (apt based) #====================================================================== upd__check_deb() { +echo upd__sudoroot # Tools: Check if user is admin sudo apt-get update -qq @@ -30,13 +31,17 @@ sudo apt list --upgradable -a 2>/dev/null \ | grep "now" \ > "$upd_file_tmp_apt" + # Converting datas +[[ -f "$upd_file_check" ]] \ + && rm -f "$upd_file_check" +touch "$upd_file_check" while read -r "pkg" "old" "new" do - pkg=`echo $pkg | awk -F"/" '{print $1}'` - new=`echo $new | awk '{print $NF}'` + pkg=`echo "$pkg" | awk -F'/' '{print $1}'` + new=`echo "$new" | awk '{print $NF}'` new=${new/]/} - echo "$pkg $old -> $new" > "$upd_file_check" + echo "$pkg $old -> $new" >> "$upd_file_check" done < <( cat "$upd_file_tmp_apt") rm -f "$upd_file_tmp_apt"