aboutsummaryrefslogtreecommitdiff
path: root/adu-download
diff options
context:
space:
mode:
authorAdam Spragg <adam@spra.gg>2022-03-13 17:36:46 +0000
committerAdam Spragg <adam@spra.gg>2022-03-13 17:36:46 +0000
commitab3461e792a3b9a525a895bb0b3a70e55955efb6 (patch)
treed8abe25eab49ade25880946a40451f42249e5e97 /adu-download
First (mostly) working version apt-desktop-upgrades
Diffstat (limited to 'adu-download')
-rwxr-xr-xadu-download39
1 files changed, 39 insertions, 0 deletions
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 <https://www.gnu.org/licenses/>.
+
+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