From ab3461e792a3b9a525a895bb0b3a70e55955efb6 Mon Sep 17 00:00:00 2001 From: Adam Spragg Date: Sun, 13 Mar 2022 17:36:46 +0000 Subject: First (mostly) working version apt-desktop-upgrades --- adu-download | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 adu-download (limited to 'adu-download') diff --git a/adu-download b/adu-download new file mode 100755 index 0000000..7d52205 --- /dev/null +++ b/adu-download @@ -0,0 +1,39 @@ +#! /bin/sh + +# Copyright © 2022 Adam Spragg +# SPDX-License-Identifier: LGPL-3.0-or-later +# +# This file is part of apt-desktop-upgrades +# +# apt-desktop-upgrades is free software: you can redistribute it and/or modify +# under the terms of the GNU Lesser General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your option) +# any later version. +# +# apt-desktop-upgrades is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License +# for more details. +# +# You should have received a copy of the GNU Lesser General Public License along +# with apt-desktop-upgrades. If not, see . + +set -e + +PREFIX=/usr/local +SBINDIR="${PREFIX}/sbin" + +UPDATE_SYMLINK="/system-update" +UPDATE_TARGET="${SBINDIR}/adu-upgrade" + +apt-get -qq update +apt-get -qq upgrade -d + +#apt-get -qq autoclean + +upgrades=$(apt -qq list --upgradeable 2>/dev/null | wc -l) + +if [ $upgrades -gt 0 ]; then + ln -s -- "${UPDATE_TARGET}" "${UPDATE_SYMLINK}" 2>/dev/null || true + echo "$upgrades updates available" +fi -- cgit v1.2.1