mirror of
https://gitea.blesmrt.net/mikaela/scripts.git
synced 2024-11-16 16:19:22 +01:00
deb-update.bash: indent comments, add one on if hash
Comments are also moved down to where they belong in case they were explaining the if hash incorrectly
This commit is contained in:
parent
41d3ad7f9b
commit
4dfb509cc4
@ -5,10 +5,11 @@
|
|||||||
# Show commands being executed
|
# Show commands being executed
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
|
# if hash checks that the command exists
|
||||||
|
if hash apt-get 2>/dev/null; then
|
||||||
# I am not sure if -y here even does anything, at least it won't work for
|
# I am not sure if -y here even does anything, at least it won't work for
|
||||||
# accepting suite changes for Debian when testing becomes stable.
|
# accepting suite changes for Debian when testing becomes stable.
|
||||||
# Checking for updates or new packages.
|
# Checking for updates or new packages.
|
||||||
if hash apt-get 2>/dev/null; then
|
|
||||||
apt-get -y update
|
apt-get -y update
|
||||||
|
|
||||||
# If arguments like -y are passed to the script, they become "$@"
|
# If arguments like -y are passed to the script, they become "$@"
|
||||||
@ -18,24 +19,24 @@ if hash apt-get 2>/dev/null; then
|
|||||||
apt-get "$@" autoremove
|
apt-get "$@" autoremove
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Flatpak apps are sandboxed and should be safe to update automatically
|
|
||||||
if hash flatpak 2>/dev/null; then
|
if hash flatpak 2>/dev/null; then
|
||||||
|
# Flatpak apps are sandboxed and should be safe to update automatically
|
||||||
flatpak update --assumeyes --noninteractive
|
flatpak update --assumeyes --noninteractive
|
||||||
# Flatpak's version of `apt autoremove`
|
# Flatpak's version of `apt autoremove`
|
||||||
flatpak uninstall --unused --assumeyes
|
flatpak uninstall --unused --assumeyes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if hash snap 2>/dev/null; then
|
||||||
# Snap packages auto-update anyway though, but I like checking them while
|
# Snap packages auto-update anyway though, but I like checking them while
|
||||||
# doing everything else too
|
# doing everything else too
|
||||||
if hash snap 2>/dev/null; then
|
|
||||||
snap refresh
|
snap refresh
|
||||||
# so I may have some sort of an idea when snap packages have been updated
|
# so I may have some sort of an idea when snap packages have been updated
|
||||||
# if they have auto-refreshed
|
# if they have auto-refreshed
|
||||||
snap changes
|
snap changes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# So the local apt-file database is up-to-date.
|
|
||||||
if hash apt-file 2>/dev/null; then
|
if hash apt-file 2>/dev/null; then
|
||||||
|
# So the local apt-file database is up-to-date.
|
||||||
apt-file update
|
apt-file update
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user