mirror of
https://github.com/RasppleII/a2server.git
synced 2024-12-22 17:29:34 +00:00
Improve Debian version detection
This commit is contained in:
parent
94d17f56cc
commit
ae89fef8b4
@ -16,14 +16,14 @@ esac
|
|||||||
useExternalURL=1
|
useExternalURL=1
|
||||||
[[ $A2SERVER_NO_EXTERNAL ]] && useExternalURL=
|
[[ $A2SERVER_NO_EXTERNAL ]] && useExternalURL=
|
||||||
|
|
||||||
debianVersion=$(cat /etc/debian_version 2> /dev/null)
|
debianVersion="$(lsb_release -rs)"
|
||||||
isRpi=
|
isRpi=
|
||||||
arch=
|
arch=
|
||||||
if [[ -f /usr/bin/raspi-config ]]; then
|
if [[ -f /usr/bin/raspi-config ]]; then
|
||||||
isRpi=1
|
isRpi=1
|
||||||
arch='rpi'
|
arch='rpi'
|
||||||
elif lsb_release -a 2> /dev/null | grep -q 'Distributor ID:.Debian'; then
|
elif [[ "$(lsb_release -ds)" = Debian* ]]; then
|
||||||
if [[ $(cut -d . -f 1 <<< $debianVersion) -ge "7" ]]; then
|
if [[ "$debianVersion" -ge 7 || $debianVersion == [a-z]* ]]; then
|
||||||
uname_m="$(uname -m)"
|
uname_m="$(uname -m)"
|
||||||
if [[ $uname_m == "i686" ]]; then
|
if [[ $uname_m == "i686" ]]; then
|
||||||
arch='debian_x86'
|
arch='debian_x86'
|
||||||
@ -33,17 +33,7 @@ elif lsb_release -a 2> /dev/null | grep -q 'Distributor ID:.Debian'; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
debianName=
|
debianName=$(lsb_release -cs)
|
||||||
if [[ $debianVersion ]]; then
|
|
||||||
debianMajor=$(cut -d . -f 1 <<< $debianVersion)
|
|
||||||
if [[ $debianMajor == "8" ]]; then
|
|
||||||
debianName="jessie"
|
|
||||||
elif [[ $debianMajor == "7" ]]; then
|
|
||||||
debianName="wheezy"
|
|
||||||
else
|
|
||||||
debianName="unknown"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "A2SERVER: Installing A2SERVER tools..."
|
echo "A2SERVER: Installing A2SERVER tools..."
|
||||||
|
|
||||||
@ -123,7 +113,7 @@ if ! hash unar &> /dev/null; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# jessie and later: Just use the unar package
|
# jessie and later: Just use the unar package
|
||||||
if [[ $debianMajor -ge 8 ]]; then
|
if [[ "$debianName" != "wheezy" ]]; then
|
||||||
sudo apt-get -y install unar
|
sudo apt-get -y install unar
|
||||||
sudo apt-get clean
|
sudo apt-get clean
|
||||||
fi
|
fi
|
||||||
|
@ -26,15 +26,15 @@ esac
|
|||||||
useExternalURL=1
|
useExternalURL=1
|
||||||
[[ $A2SERVER_NO_EXTERNAL ]] && useExternalURL=
|
[[ $A2SERVER_NO_EXTERNAL ]] && useExternalURL=
|
||||||
|
|
||||||
debianVersion=$(cat /etc/debian_version 2> /dev/null)
|
debianVersion="$(lsb_release -rs)"
|
||||||
isRpi=
|
isRpi=
|
||||||
arch=
|
arch=
|
||||||
if [[ -f /usr/bin/raspi-config ]]; then
|
if [[ -f /usr/bin/raspi-config ]]; then
|
||||||
isRpi=1
|
isRpi=1
|
||||||
arch='rpi'
|
arch='rpi'
|
||||||
elif lsb_release -a 2> /dev/null | grep -q 'Distributor ID:.Debian'; then
|
elif [[ "$(lsb_release -ds)" = Debian* ]]; then
|
||||||
if [[ $(cut -d . -f 1 <<< $debianVersion) -ge "7" ]]; then
|
if [[ "$debianVersion" -ge 7 || $debianVersion == [a-z]* ]]; then
|
||||||
uname_m="$(uname -m)"
|
uname_m="$(uname -m)"
|
||||||
if [[ $uname_m == "i686" ]]; then
|
if [[ $uname_m == "i686" ]]; then
|
||||||
arch='debian_x86'
|
arch='debian_x86'
|
||||||
elif [[ $uname_m == "x86_64" ]]; then
|
elif [[ $uname_m == "x86_64" ]]; then
|
||||||
@ -43,23 +43,13 @@ elif lsb_release -a 2> /dev/null | grep -q 'Distributor ID:.Debian'; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
debianName=
|
debianName=$(lsb_release -cs)
|
||||||
if [[ $debianVersion ]]; then
|
|
||||||
debianMajor=$(cut -d . -f 1 <<< $debianVersion)
|
|
||||||
if [[ $debianMajor == "8" ]]; then
|
|
||||||
debianName="jessie"
|
|
||||||
elif [[ $debianMajor == "7" ]]; then
|
|
||||||
debianName="wheezy"
|
|
||||||
else
|
|
||||||
debianName="unknown"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# skip this if already done
|
# skip this if already done
|
||||||
if [[ -f /usr/local/etc/A2SERVER-version ]]; then
|
if [[ -f /usr/local/etc/A2SERVER-version ]]; then
|
||||||
read a2sVersion </usr/local/etc/A2SERVER-version
|
read a2sVersion </usr/local/etc/A2SERVER-version
|
||||||
fi
|
fi
|
||||||
if [[ $a2sVersion = *.*.* || $a2sVersion -ge 101]]; then
|
if [[ "$a2sVersion" != *.*.* || "$a2sVersion" -lt 101 ]]; then
|
||||||
echo "A2SERVER: Installing Netatalk (this will take a while)..."
|
echo "A2SERVER: Installing Netatalk (this will take a while)..."
|
||||||
# stop Netatalk and samba if running (during upgrade)
|
# stop Netatalk and samba if running (during upgrade)
|
||||||
if [[ $(ps --no-headers -C afpd) ]]; then
|
if [[ $(ps --no-headers -C afpd) ]]; then
|
||||||
|
@ -19,9 +19,8 @@ password="your password"
|
|||||||
[[ $isApple2Pw ]] && password="'apple2'"
|
[[ $isApple2Pw ]] && password="'apple2'"
|
||||||
[[ $isRaspberryPw ]] && password="'raspberry'"
|
[[ $isRaspberryPw ]] && password="'raspberry'"
|
||||||
|
|
||||||
isDebian=
|
if [[ "$(lsb_release -ds)" = Debian* ]]; then
|
||||||
if lsb_release -a 2> /dev/null | grep -q 'Distributor ID:.Debian'; then
|
if [[ "$debianVersion" -ge 7 || $debianVersion == [a-z]* ]]; then
|
||||||
if [[ $(cut -d . -f 1 < /etc/debian_version) -ge "7" ]]; then
|
|
||||||
isDebian=1
|
isDebian=1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -36,11 +36,10 @@ isRpi=
|
|||||||
[[ -f /usr/bin/raspi-config ]] && isRpi=1
|
[[ -f /usr/bin/raspi-config ]] && isRpi=1
|
||||||
|
|
||||||
isDebian=
|
isDebian=
|
||||||
if lsb_release -a 2> /dev/null | grep -q 'Distributor ID:.Debian'; then
|
if [[ "$(lsb_release -ds)" = Debian* ]]; then
|
||||||
if [[ -f /etc/debian_version ]]; then
|
debianVersion="$(lsb_release -rs)"
|
||||||
if [[ $(cut -d . -f 1 < /etc/debian_version) -ge "7" ]]; then
|
if [[ "$debianVersion" -ge 7 || $debianVersion == [a-z]* ]]; then
|
||||||
isDebian=1
|
isDebian=1
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user