mirror of
https://github.com/YunoHost/install_script.git
synced 2024-09-03 20:06:25 +02:00
Fixes following tests
This commit is contained in:
parent
89f4ffe4c0
commit
ec297b87e0
1 changed files with 9 additions and 8 deletions
|
@ -20,7 +20,6 @@ set -u
|
||||||
# Globals
|
# Globals
|
||||||
|
|
||||||
readonly YUNOHOST_LOG="/var/log/yunohost-installation.log"
|
readonly YUNOHOST_LOG="/var/log/yunohost-installation.log"
|
||||||
readonly THIS_MACHINE_RELEASE="$(lsb_release -c | awk '{print $2}')"
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Main functions #
|
# Main functions #
|
||||||
|
@ -49,7 +48,7 @@ function parse_options()
|
||||||
BUILD_IMAGE=0
|
BUILD_IMAGE=0
|
||||||
FORCE=0
|
FORCE=0
|
||||||
|
|
||||||
while getopts ":aid:h" option; do
|
while getopts ":aid:fh" option; do
|
||||||
case $option in
|
case $option in
|
||||||
a)
|
a)
|
||||||
AUTOMODE=1
|
AUTOMODE=1
|
||||||
|
@ -83,7 +82,9 @@ function parse_options()
|
||||||
|
|
||||||
function main()
|
function main()
|
||||||
{
|
{
|
||||||
parse_options
|
parse_options "$@"
|
||||||
|
|
||||||
|
rm -f $YUNOHOST_LOG
|
||||||
|
|
||||||
check_assertions
|
check_assertions
|
||||||
|
|
||||||
|
@ -203,10 +204,10 @@ function check_assertions()
|
||||||
# Assert we're on Stretch
|
# Assert we're on Stretch
|
||||||
# Note : we do not rely on lsb_release to avoid installing a dependency
|
# Note : we do not rely on lsb_release to avoid installing a dependency
|
||||||
# only to check this...
|
# only to check this...
|
||||||
[[ ! "$(cat /etc/debian_version)" =~ ^9.* ]] || die "This script can only be ran on Debian Stretch."
|
[[ "$(cat /etc/debian_version)" =~ ^9.* ]] || die "This script can only be ran on Debian Stretch."
|
||||||
|
|
||||||
# Assert we're root
|
# Assert we're root
|
||||||
[[ "$(id -u)" != "0" ]] || die "This script must be run as root."
|
[[ "$(id -u)" == "0" ]] || die "This script must be run as root."
|
||||||
|
|
||||||
# Assert systemd is installed
|
# Assert systemd is installed
|
||||||
command -v systemctl > /dev/null || die "YunoHost requires systemd to be installed."
|
command -v systemctl > /dev/null || die "YunoHost requires systemd to be installed."
|
||||||
|
@ -218,10 +219,10 @@ function check_assertions()
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check possible conflict with apache, bind9.
|
# Check possible conflict with apache, bind9.
|
||||||
[[ -z "$(dpkg --list | grep ' bind9')" ]] || [[ "$FORCE" == "1" ]] \
|
[[ -z "$(dpkg --get-selections | grep -v deinstall | grep 'bind9 ')" ]] || [[ "$FORCE" == "1" ]] \
|
||||||
|| die "Bind9 is installed and might conflict with dnsmasq. Uninstall it first, or if you know what you are doing, run this script with -f."
|
|| die "Bind9 is installed and might conflict with dnsmasq. Uninstall it first, or if you know what you are doing, run this script with -f."
|
||||||
|
|
||||||
[[ -z "$(dpkg --list | grep ' apache2')" ]] || [[ "$FORCE" == "1" ]] \
|
[[ -z "$(dpkg --get-selections | grep -v deinstall | grep 'apache2 ')" ]] || [[ "$FORCE" == "1" ]] \
|
||||||
|| die "Apache is installed and might conflict with nginx. Uninstall it first, or if you know what you are doing, run this script with -f."
|
|| die "Apache is installed and might conflict with nginx. Uninstall it first, or if you know what you are doing, run this script with -f."
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -517,4 +518,4 @@ function clean_image() {
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
main
|
main "$@"
|
||||||
|
|
Loading…
Add table
Reference in a new issue