mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Add Debian
This commit is contained in:
@@ -949,17 +949,12 @@ detect_os() {
|
|||||||
OS=rocky
|
OS=rocky
|
||||||
OSVER=9
|
OSVER=9
|
||||||
is_rocky=true
|
is_rocky=true
|
||||||
pkgman="dnf"
|
is_rpm=true
|
||||||
elif grep -q "CentOS Stream release 9" /etc/redhat-release; then
|
elif grep -q "CentOS Stream release 9" /etc/redhat-release; then
|
||||||
OS=centos
|
OS=centos
|
||||||
OSVER=9
|
OSVER=9
|
||||||
is_centos=true
|
is_centos=true
|
||||||
pkgman=dnf
|
is_rpm=true
|
||||||
else
|
|
||||||
info "We do not support the operating system you are trying to use."
|
|
||||||
fail_setup
|
|
||||||
fi
|
|
||||||
|
|
||||||
elif [ -f /etc/os-release ]; then
|
elif [ -f /etc/os-release ]; then
|
||||||
OS=ubuntu
|
OS=ubuntu
|
||||||
if grep -q "UBUNTU_CODENAME=focal" /etc/os-release; then
|
if grep -q "UBUNTU_CODENAME=focal" /etc/os-release; then
|
||||||
@@ -970,9 +965,13 @@ detect_os() {
|
|||||||
OSVER=jammy
|
OSVER=jammy
|
||||||
UBVER=22.04
|
UBVER=22.04
|
||||||
is_ubuntu=true
|
is_ubuntu=true
|
||||||
else
|
is_deb=true
|
||||||
info "We do not support your current version of Ubuntu."
|
elif grep -q "VERSION_CODENAME=bookworm" /etc/os-release; then
|
||||||
fail_setup
|
OSVER=bookworm
|
||||||
|
DEBVER=12
|
||||||
|
is_debian=true
|
||||||
|
OS=debian
|
||||||
|
is_deb=true
|
||||||
fi
|
fi
|
||||||
installer_prereq_packages
|
installer_prereq_packages
|
||||||
|
|
||||||
@@ -1859,7 +1858,7 @@ reset_proxy() {
|
|||||||
|
|
||||||
[[ -f /etc/gitconfig ]] && rm -f /etc/gitconfig
|
[[ -f /etc/gitconfig ]] && rm -f /etc/gitconfig
|
||||||
|
|
||||||
if [[ $is_rocky || $is_centos ]]; then
|
if [[ $is_rpm ]]; then
|
||||||
sed -i "/proxy=/d" /etc/dnf/dnf.conf
|
sed -i "/proxy=/d" /etc/dnf/dnf.conf
|
||||||
else
|
else
|
||||||
[[ -f /etc/apt/apt.conf.d/00-proxy.conf ]] && rm -f /etc/apt/apt.conf.d/00-proxy.conf
|
[[ -f /etc/apt/apt.conf.d/00-proxy.conf ]] && rm -f /etc/apt/apt.conf.d/00-proxy.conf
|
||||||
@@ -1905,7 +1904,7 @@ drop_install_options() {
|
|||||||
|
|
||||||
remove_package() {
|
remove_package() {
|
||||||
local package_name=$1
|
local package_name=$1
|
||||||
if [[ $is_rocky || $is_centos ]]; then
|
if [[ $is_rpm ]]; then
|
||||||
if rpm -qa | grep -q "$package_name"; then
|
if rpm -qa | grep -q "$package_name"; then
|
||||||
logCmd "dnf remove -y $package_name"
|
logCmd "dnf remove -y $package_name"
|
||||||
fi
|
fi
|
||||||
@@ -1926,7 +1925,7 @@ remove_package() {
|
|||||||
|
|
||||||
securityonion_repo() {
|
securityonion_repo() {
|
||||||
# Remove all the current repos
|
# Remove all the current repos
|
||||||
if [[ $is_rocky || $is_centos ]]; then
|
if [[ $is_rocky ]]; then
|
||||||
logCmd "dnf -v clean all"
|
logCmd "dnf -v clean all"
|
||||||
logCmd "mkdir -vp /root/oldrepos"
|
logCmd "mkdir -vp /root/oldrepos"
|
||||||
logCmd "mv -v /etc/yum.repos.d/* /root/oldrepos/"
|
logCmd "mv -v /etc/yum.repos.d/* /root/oldrepos/"
|
||||||
@@ -2365,22 +2364,6 @@ so_add_user() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
ubuntu_check() {
|
|
||||||
if [[ $is_ubuntu ]]; then
|
|
||||||
if [[ $waitforstate ]]; then
|
|
||||||
whiptail_ubuntu_notsupported
|
|
||||||
fail_setup
|
|
||||||
else
|
|
||||||
if [[ $UBUNTUINSTALL == "needtoupgrade" ]]; then
|
|
||||||
whiptail_ubuntu_warning
|
|
||||||
else
|
|
||||||
whiptail_ubuntu_notsupported
|
|
||||||
fail_setup
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
update_sudoers_for_testing() {
|
update_sudoers_for_testing() {
|
||||||
if [ -n "$TESTING" ]; then
|
if [ -n "$TESTING" ]; then
|
||||||
info "Ensuring $INSTALLUSERNAME has password-less sudo access for automated testing purposes."
|
info "Ensuring $INSTALLUSERNAME has password-less sudo access for automated testing purposes."
|
||||||
@@ -2389,15 +2372,12 @@ update_sudoers_for_testing() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
update_packages() {
|
update_packages() {
|
||||||
if [[ $is_rocky || $is_centos ]]; then
|
if [[ $is_rocky ]]; then
|
||||||
logCmd "dnf repolist"
|
logCmd "dnf repolist"
|
||||||
logCmd "dnf -y update --allowerasing --exclude=salt*,docker*,containerd*"
|
logCmd "dnf -y update --allowerasing --exclude=salt*,docker*,containerd*"
|
||||||
if [[ $is_rocky ]]; then
|
if [[ $is_rocky ]]; then
|
||||||
RMREPOFILES=("rocky-addons.repo" "rocky-devel.repo" "rocky-extras.repo" "rocky.repo")
|
RMREPOFILES=("rocky-addons.repo" "rocky-devel.repo" "rocky-extras.repo" "rocky.repo")
|
||||||
info "Removing repo files added by rocky-repos package update"
|
info "Removing repo files added by rocky-repos package update"
|
||||||
else
|
|
||||||
RMREPOFILES=("centos-addons.repo" "centos-devel.repo" "centos-extras.repo" "centos.repo")
|
|
||||||
info "Removing repo files added by centos-repos package update"
|
|
||||||
fi
|
fi
|
||||||
for FILE in ${RMREPOFILES[@]}; do
|
for FILE in ${RMREPOFILES[@]}; do
|
||||||
logCmd "rm -f /etc/yum.repos.d/$FILE"
|
logCmd "rm -f /etc/yum.repos.d/$FILE"
|
||||||
|
|||||||
Reference in New Issue
Block a user