Repository: microsoft/onefuzz
File: src/runtime-tools/linux/setup.sh (Shell)

Code before:
        logger "apt failed, sleeping 10s then retrying"
        sleep 10
    done

    logger "downloading dotnet install"
    curl --retry 10 -sSL https://dot.net/v1/dotnet-install.sh -o dotnet-install.sh 2>&1 | logger -s -i -t 'onefuzz-curl-dotnet-install'
    chmod +x dotnet-install.sh

    for version in "${DOTNET_VERSIONS[@]}"; do
        logger "running dotnet install $version"
        /bin/bash ./dotnet-install.sh --version "$version" --install-dir "$DOTNET_ROOT" 2>&1 | logger -s -i -t 'onefuzz-dotnet-setup'
    done
    rm dotnet-install.sh

    logger "install dotnet tools"
    pushd "$DOTNET_ROOT"
    ls -lah 2>&1 | logger -s -i -t 'onefuzz-dotnet-tools'
    "$DOTNET_ROOT"/dotnet tool install dotnet-dump --version 6.0.351802 --tool-path /onefuzz/tools 2>&1 | logger -s -i -t 'onefuzz-dotnet-tools'
    "$DOTNET_ROOT"/dotnet tool install dotnet-coverage --version 17.5 --tool-path /onefuzz/tools 2>&1 | logger -s -i -t 'onefuzz-dotnet-tools'
    "$DOTNET_ROOT"/dotnet tool install dotnet-sos --version 6.0.351802 --tool-path /onefuzz/tools 2>&1 | logger -s -i -t 'onefuzz-dotnet-tools'
    popd
fi

if  [[ ! -z DOCKER_BUILD ]]
then
    echo "buidling for docker docker"
elif [ -d /etc/systemd/system ]; then
    logger "onefuzz: setting up systemd"
    sudo chmod 644 /onefuzz/tools/linux/onefuzz.service
    sudo chown root /onefuzz/tools/linux/onefuzz.service
    sudo ln -s /onefuzz/tools/linux/onefuzz.service /etc/systemd/system/onefuzz.service
    sudo systemctl enable onefuzz
    if [ "X$2" == "Xreboot" ]; then
        logger "onefuzz: restarting"
        echo rebooting
        sudo reboot
    else
        logger "onefuzz: starting via systemd"
        sudo systemctl start onefuzz
    fi
elif [ -d /etc/init.d ]; then
    logger "onefuzz: setting up init.d"
    sudo chown root /onefuzz/tools/linux/onefuzz.initd
    sudo ln -s /onefuzz/tools/linux/onefuzz.initd /etc/init.d/onefuzz
    RCDIRS=/etc/rc2.d /etc/rc3.d /etc/rc4.d /etc/rc5.d
    for RCDIR in ${RCDRS}; do
        if [ -d ${RCDIR} ]; then
            sudo ln -s /onefuzz/tools/linux/onefuzz.initd ${RCDIR}/S99onefuzz
        fi
    done
    if [ "X$2" == "Xreboot" ]; then

Review comment (suggestion):
```suggestion
    echo "building for docker"
```

Code after:
        logger "apt failed, sleeping 10s then retrying"
        sleep 10
    done

    logger "downloading dotnet install"
    curl --retry 10 -sSL https://dot.net/v1/dotnet-install.sh -o dotnet-install.sh 2>&1 | logger -s -i -t 'onefuzz-curl-dotnet-install'
    chmod +x dotnet-install.sh

    for version in "${DOTNET_VERSIONS[@]}"; do
        logger "running dotnet install $version"
        /bin/bash ./dotnet-install.sh --version "$version" --install-dir "$DOTNET_ROOT" 2>&1 | logger -s -i -t 'onefuzz-dotnet-setup'
    done
    rm dotnet-install.sh

    logger "install dotnet tools"
    pushd "$DOTNET_ROOT"
    ls -lah 2>&1 | logger -s -i -t 'onefuzz-dotnet-tools'
    "$DOTNET_ROOT"/dotnet tool install dotnet-dump --version 6.0.351802 --tool-path /onefuzz/tools 2>&1 | logger -s -i -t 'onefuzz-dotnet-tools'
    "$DOTNET_ROOT"/dotnet tool install dotnet-coverage --version 17.5 --tool-path /onefuzz/tools 2>&1 | logger -s -i -t 'onefuzz-dotnet-tools'
    "$DOTNET_ROOT"/dotnet tool install dotnet-sos --version 6.0.351802 --tool-path /onefuzz/tools 2>&1 | logger -s -i -t 'onefuzz-dotnet-tools'
    popd
fi

if  [ -v DOCKER_BUILD ]; then
    echo "building for docker"
elif [ -d /etc/systemd/system ]; then
    logger "onefuzz: setting up systemd"
    sudo chmod 644 /onefuzz/tools/linux/onefuzz.service
    sudo chown root /onefuzz/tools/linux/onefuzz.service
    sudo ln -s /onefuzz/tools/linux/onefuzz.service /etc/systemd/system/onefuzz.service
    sudo systemctl enable onefuzz
    if [ "X$2" == "Xreboot" ]; then
        logger "onefuzz: restarting"
        echo rebooting
        sudo reboot
    else
        logger "onefuzz: starting via systemd"
        sudo systemctl start onefuzz
    fi
elif [ -d /etc/init.d ]; then
    logger "onefuzz: setting up init.d"
    sudo chown root /onefuzz/tools/linux/onefuzz.initd
    sudo ln -s /onefuzz/tools/linux/onefuzz.initd /etc/init.d/onefuzz
    RCDIRS=/etc/rc2.d /etc/rc3.d /etc/rc4.d /etc/rc5.d
    for RCDIR in ${RCDRS}; do
        if [ -d ${RCDIR} ]; then
            sudo ln -s /onefuzz/tools/linux/onefuzz.initd ${RCDIR}/S99onefuzz
        fi
    done
    if [ "X$2" == "Xreboot" ]; then
        logger "onefuzz: rebooting"