alpha 0.1
This commit is contained in:
21
lib/os-detect.sh
Normal file
21
lib/os-detect.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
detect_os() {
|
||||
. /etc/os-release
|
||||
OS_ID=$ID
|
||||
OS_VERSION=$VERSION_ID
|
||||
|
||||
case $OS_ID in
|
||||
ubuntu|debian)
|
||||
PKG=apt
|
||||
SSHD=sshd
|
||||
;;
|
||||
almalinux|rocky|centos|fedora)
|
||||
PKG=dnf
|
||||
SSHD=sshd
|
||||
;;
|
||||
*)
|
||||
err "Неподдерживаемая ОС"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
log "ОС: $OS_ID $OS_VERSION"
|
||||
}
|
||||
Reference in New Issue
Block a user