Compare commits
2 Commits
334e5bd179
...
776fcc9023
| Author | SHA1 | Date | |
|---|---|---|---|
| 776fcc9023 | |||
| 4e4c9a1bf5 |
0
bin/getsong
Normal file → Executable file
0
bin/getsong
Normal file → Executable file
46
bin/system-update
Executable file
46
bin/system-update
Executable file
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
set -u
|
||||
set -o pipefail
|
||||
|
||||
# Ensure running as root
|
||||
if [ $EUID != 0 ]; then
|
||||
sudo "$0" "$@"
|
||||
exit $?
|
||||
fi
|
||||
|
||||
# Determining the current OS
|
||||
if [ -f /etc/os-release ]; then
|
||||
# freedesktop.org and systemd
|
||||
. /etc/os-release
|
||||
OS=$NAME
|
||||
VER=$VERSION_ID
|
||||
elif type lsb_release >/dev/null 2>&1; then
|
||||
# linuxbase.org
|
||||
OS=$(lsb_release -si)
|
||||
VER=$(lsb_release -sr)
|
||||
elif [ -f /etc/lsb-release ]; then
|
||||
# For some versions of Debian/Ubuntu without lsb_release command
|
||||
. /etc/lsb-release
|
||||
OS=$DISTRIB_ID
|
||||
VER=$DISTRIB_RELEASE
|
||||
elif [ -f /etc/debian_version ]; then
|
||||
# Older Debian/Ubuntu/etc.
|
||||
OS=Debian
|
||||
VER=$(cat /etc/debian_version)
|
||||
else
|
||||
# Fall back to uname, e.g. "Linux <version>", also works for BSD, etc.
|
||||
OS=$(uname -s)
|
||||
VER=$(uname -r)
|
||||
fi
|
||||
|
||||
# Update commands per OS
|
||||
case $OS in
|
||||
Fedora\ Linux)
|
||||
exec dnf upgrade --refresh;
|
||||
exec flatpak update --assumeyes;
|
||||
;;
|
||||
*)
|
||||
echo "Cannot update system with OS: " $OS
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user