mirror of
https://github.com/mrworf/plexupdate.git
synced 2025-08-14 18:47:16 -07:00
Move all distro checking logic to plexupdate-core
This commit is contained in:
parent
0065210791
commit
fd540b0325
4 changed files with 32 additions and 40 deletions
BIN
extras/.installer.sh.swp
Normal file
BIN
extras/.installer.sh.swp
Normal file
Binary file not shown.
|
@ -34,6 +34,7 @@ install() {
|
|||
sleep 1
|
||||
|
||||
[ -z "$DISTRO_INSTALL" ] && check_distro
|
||||
DISTRO_INSTALL="${DISTRO_INSTALL} install"
|
||||
|
||||
if [ $EUID -ne 0 ]; then
|
||||
sudo $DISTRO_INSTALL $1 || abort "Failed while trying to install '$1'. Please install it manually and try again."
|
||||
|
@ -42,24 +43,6 @@ install() {
|
|||
fi
|
||||
}
|
||||
|
||||
check_distro() {
|
||||
if [ -f /etc/redhat-release ] && hash dnf 2>/dev/null; then
|
||||
DISTRO="redhat"
|
||||
DISTRO_INSTALL="dnf -y install"
|
||||
elif [ -f /etc/redhat-release ] && hash yum 2>/dev/null; then
|
||||
DISTRO="redhat" #or CentOS but functionally the same
|
||||
DISTRO_INSTALL="yum -y install"
|
||||
elif hash apt 2>/dev/null; then
|
||||
DISTRO="debian" #or Ubuntu
|
||||
DISTRO_INSTALL="apt install"
|
||||
elif hash apt-get 2>/dev/null; then
|
||||
DISTRO="debian"
|
||||
DISTRO_INSTALL="apt-get install"
|
||||
else
|
||||
DISTRO="unknown"
|
||||
fi
|
||||
}
|
||||
|
||||
yesno() {
|
||||
case "$1" in
|
||||
"")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue