File tree 17 files changed +55
-35
lines changed
17 files changed +55
-35
lines changed Original file line number Diff line number Diff line change 93
93
exit 0
94
94
fi
95
95
96
+ if test -f /etc/oracle-release || test -f /etc/enterprise-release
97
+ then
98
+ echo oraclelinux
99
+ exit 0
100
+ fi
101
+
96
102
if test -f /etc/redhat-release
97
103
then
98
104
if grep -q ' ^CentOS ' /etc/redhat-release
Original file line number Diff line number Diff line change 184
184
(redhat|centos|almalinux|eurolinux|rocky|mitel|scientific)
185
185
sed -e ' s/^\([A-Za-z]* \)*release \(.*\) (.*)$/\2/' /etc/redhat-release
186
186
;;
187
+ (oraclelinux)
188
+ if test -r /etc/oracle-release
189
+ then
190
+ # Oracle Linux >= 5
191
+ sed -e ' s/^\([A-Za-z]* \)*release \(.*\)$/\2/' /etc/oracle-release
192
+ elif test -r /etc/enterprise-release
193
+ then
194
+ # older versions
195
+ sed -e ' s/^\([A-Za-z]* \)*release \(.*\) (.*)$/\2/' /etc/enterprise-release
196
+ fi
197
+ ;;
187
198
(slackware)
188
199
sed -e ' s/^Slackware //' /etc/slackware-version
189
200
;;
Original file line number Diff line number Diff line change 32
32
case ${os}
33
33
in
34
34
# RedHat-derivatives and BSDs
35
- (centos|fedora|redhat|scientific|freebsd|macosx|netbsd|openbsd)
35
+ (centos|fedora|redhat|scientific|oraclelinux| freebsd|macosx|netbsd|openbsd)
36
36
# Hostname is FQDN
37
37
name_should=${__target_host:? }
38
38
;;
67
67
" && hostnamectl set-hostname '${name_should} '" \
68
68
" || hostname '${name_should} '"
69
69
;;
70
- (centos|fedora|redhat|scientific|crux|freebsd|netbsd|openbsd|gentoo|void)
70
+ (centos|fedora|redhat|scientific|oraclelinux| crux|freebsd|netbsd|openbsd|gentoo|void)
71
71
echo " hostname '${name_should} '"
72
72
;;
73
73
(openwrt)
Original file line number Diff line number Diff line change 36
36
case ${os}
37
37
in
38
38
# RedHat-derivatives and BSDs
39
- (centos|fedora|redhat|scientific|freebsd|netbsd|openbsd|slackware|suse)
39
+ (centos|fedora|redhat|scientific|oraclelinux| freebsd|netbsd|openbsd|slackware|suse)
40
40
# Hostname is FQDN
41
41
name_should=${__target_host:? }
42
42
;;
77
77
# --value "\"${name_should}\""
78
78
fi
79
79
;;
80
- (centos|fedora|redhat|scientific)
80
+ (centos|fedora|redhat|scientific|oraclelinux )
81
81
if test -z " ${has_hostnamectl} "
82
82
then
83
83
# Only write to /etc/sysconfig/network on non-systemd versions.
Original file line number Diff line number Diff line change 62
62
unset -v CDIST_ORDER_DEPENDENCY
63
63
fi
64
64
;;
65
- (centos|fedora|redhat|scientific)
65
+ (centos|fedora|redhat|scientific|oraclelinux )
66
66
read -r os_version < " ${__global:? } /explorer/os_version"
67
67
os_major=${os_version%% [!0-9]* }
68
68
case ${os}
69
69
in
70
- (centos|almalinux|rocky|scientific|eurolinux)
70
+ (centos|almalinux|rocky|scientific|eurolinux|oraclelinux )
71
71
update_sysconfig=$( test $(( os_major)) -lt 6 && echo true || echo false)
72
72
;;
73
73
(fedora)
90
90
;;
91
91
esac
92
92
93
- if ${update_sysconfig: ? }
93
+ if ${update_sysconfig?}
94
94
then
95
- export CDIST_ORDER_DEPENDENCY=true
96
95
__file /etc/sysconfig/clock --state present \
97
- --owner root --group root --mode 0644
96
+ --owner 0 --group 0 --mode 0644
97
+ require=__file/etc/sysconfig/clock \
98
98
__key_value /etc/sysconfig/clock:UTC \
99
99
--file /etc/sysconfig/clock \
100
- --key UTC \
101
100
--delimiter ' =' --exact_delimiter \
101
+ --key ' UTC' \
102
102
--value " $( ${local_clock?} && echo false || echo true) "
103
- unset -v CDIST_ORDER_DEPENDENCY
104
103
fi
105
104
;;
106
105
(debian|devuan|ubuntu)
Original file line number Diff line number Diff line change 83
83
(archlinux)
84
84
locale_conf=' /etc/locale.conf'
85
85
;;
86
- (centos|redhat|scientific)
86
+ (redhat|centos|almalinux|eurolinux|rocky|oraclelinux)
87
+ # NOTE: This is a hack to differentiate Red Hat Linux from
88
+ # RHEL. Red Hat Linux >= 7 does not have os-release and will
89
+ # thus fall back to /etc/sysconfig/i18n.
87
90
# shellcheck source=/dev/null
88
91
version_id=$( . " ${__global:? } /explorer/os_release" && echo " ${VERSION_ID:- 0} " )
89
92
if version_ge " ${version_id} " 7
94
97
fi
95
98
;;
96
99
(fedora)
97
- # shellcheck source=/dev/null
98
- version_id=$( . " ${__global:? } /explorer/os_release" && echo " ${VERSION_ID:- 0} " )
99
- if version_ge " ${version_id} " 18
100
+ read -r os_version < " ${__global:? } /explorer/os_version"
101
+ if version_ge " ${os_version} " 18
100
102
then
101
103
locale_conf=' /etc/locale.conf'
102
104
quote_value=false
Original file line number Diff line number Diff line change 72
72
printf ' %s does not support locales.\n' " ${os} " >&2
73
73
exit 1
74
74
;;
75
- (archlinux|debian|devuan|ubuntu|suse|centos|almalinux|eurolinux|rocky|fedora|redhat|scientific)
75
+ (archlinux|debian|devuan|ubuntu|suse|centos|almalinux|eurolinux|rocky|fedora|redhat|scientific|oraclelinux )
76
76
# FIXME: The code below only works for glibc-based installations.
77
77
78
78
# NOTE: Hardcoded, create a pull request in case it is at another
Original file line number Diff line number Diff line change 32
32
os=$( cat " ${__global:? } /explorer/os" )
33
33
case ${os}
34
34
in
35
- (amazon|scientific|centos|almalinux|eurolinux|rocky|fedora|redhat) type=' yum' ;;
35
+ (amazon|scientific|centos|almalinux|eurolinux|oraclelinux|rocky|fedora|redhat)
36
+ type=' yum' ;;
36
37
(archlinux) type=' pacman' ;;
37
38
(debian|ubuntu|devuan) type=' apt' ;;
38
39
(freebsd)
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ state_should=$(cat "${__object:?}/parameter/state")
39
39
os=$( cat " ${__global:? } /explorer/os" )
40
40
case ${os}
41
41
in
42
- (scientific|centos|almalinux|eurolinux|rocky|redhat|amazon)
42
+ (scientific|centos|almalinux|eurolinux|rocky|redhat|oraclelinux| amazon)
43
43
opts=' -y --quiet' ;;
44
44
(* )
45
45
opts=' --assumeyes --quiet' ;;
Original file line number Diff line number Diff line change 58
58
version_ge " ${os_version} " 10.04 || package_name=' debianutils'
59
59
pkg_type=' apt'
60
60
;;
61
- (centos|fedora|redhat|scientific)
61
+ (centos|fedora|redhat|scientific|oraclelinux )
62
62
pkg_type=' yum'
63
63
;;
64
64
(* )
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ state_should=$(cat "${__object:?}/parameter/state")
24
24
25
25
case ${os}
26
26
in
27
- (alpine|centos|almalinux|eurolinux|rocky|fedora|redhat|scientific|debian|devuan|ubuntu)
27
+ (alpine|centos|almalinux|eurolinux|rocky|fedora|redhat|scientific|oraclelinux| debian|devuan|ubuntu)
28
28
if test " ${state_should} " ! = ' absent'
29
29
then
30
30
__package openssh-server --state present
Original file line number Diff line number Diff line change 63
63
[ -f " /etc/init/${name} .conf" ] && state=' present'
64
64
;;
65
65
66
- (amazon|scientific|centos|almalinux|eurolinux|rocky|fedora|owl|redhat)
67
- state=$( chkconfig --level " ${runlevel} " " ${name} " || echo absent)
68
- test -n " ${state} " || state=' present'
66
+ (amazon|scientific|centos|almalinux|eurolinux|rocky|fedora|owl|redhat|oraclelinux)
67
+ if chkconfig --level " ${runlevel} " " ${name} " > /dev/null 2>&1
68
+ then
69
+ state=' present'
70
+ else
71
+ state=' absent'
72
+ fi
69
73
;;
70
74
(suse)
71
75
# check for target if set, usable for boot. services in runlevel B
Original file line number Diff line number Diff line change 42
42
else
43
43
case ${os}
44
44
in
45
- (debian|devuan)
45
+ (debian|devuan|ubuntu )
46
46
echo " update-rc.d '${name} ' defaults >/dev/null"
47
47
;;
48
48
49
49
(alpine|gentoo)
50
50
echo " rc-update add '${name} ' '${target_runlevel} '"
51
51
;;
52
52
53
- (amazon|scientific|centos|almalinux|eurolinux|rocky|fedora|owl|redhat|suse)
53
+ (amazon|scientific|centos|almalinux|eurolinux|rocky|fedora|owl|redhat|oraclelinux| suse)
54
54
echo " chkconfig '${name} ' on"
55
55
;;
56
56
61
61
echo " '/etc/init.d/${name} ' enable || test -f /etc/rc.d/S??'${name} '"
62
62
;;
63
63
64
- (ubuntu)
65
- echo " update-rc.d '${name} ' defaults >/dev/null"
66
- ;;
67
64
68
65
(freebsd)
69
66
: # handled in manifest
83
80
;;
84
81
85
82
(absent)
86
- if [ " ${init} " = ' systemd' ]
83
+ if test " ${init} " = ' systemd'
87
84
then
88
85
# this handles ALL linux distros with systemd
89
86
# e.g. archlinux, gentoo in some cases, new RHEL and SLES versions
90
87
echo " systemctl -q disable '${name} '"
91
88
else
92
89
case ${os}
93
90
in
94
- (debian|ubuntu| devuan)
91
+ (debian|devuan|ubuntu )
95
92
echo " update-rc.d -f '${name} ' remove"
96
93
;;
97
94
98
95
(alpine|gentoo)
99
96
echo " rc-update del '${name} ' '${target_runlevel} '"
100
97
;;
101
98
102
- (centos|fedora|owl|redhat|suse)
99
+ (amazon|scientific| centos|almalinux|eurolinux|rocky| fedora|owl|redhat|oraclelinux |suse)
103
100
echo " chkconfig '${name} ' off"
104
101
;;
105
102
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ state_should=$(cat "${__object:?}/parameter/state")
28
28
29
29
case ${os}
30
30
in
31
- (alpine|archlinux|gentoo|debian|devuan|ubuntu|centos|almalinux|eurolinux|rocky|fedora|scientific|suse|freebsd|openbsd)
31
+ (alpine|archlinux|gentoo|debian|devuan|ubuntu|centos|almalinux|eurolinux|rocky|fedora|scientific|oraclelinux| suse|freebsd|openbsd)
32
32
if test " ${state_should} " ! = ' absent'
33
33
then
34
34
__package subversion
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ os=$(cat "${__global:?}/explorer/os")
32
32
case ${os}
33
33
in
34
34
# Linux
35
- (redhat|centos|almalinux|eurolinux|rocky|ubuntu|debian|devuan|archlinux|gentoo|coreos)
35
+ (redhat|centos|almalinux|eurolinux|rocky|oraclelinux| ubuntu|debian|devuan|archlinux|gentoo|coreos)
36
36
flag=' -w'
37
37
;;
38
38
# BusyBox
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ os=$(cat "${__global:?}/explorer/os")
26
26
case ${os}
27
27
in
28
28
# Linux
29
- (alpine|redhat|centos|almalinux|eurolinux|rocky|ubuntu|debian|devuan|archlinux|coreos)
29
+ (alpine|redhat|centos|almalinux|eurolinux|rocky|oraclelinux| ubuntu|debian|devuan|archlinux|coreos)
30
30
:
31
31
;;
32
32
# BSD
Original file line number Diff line number Diff line change 46
46
(debian|ubuntu|devuan)
47
47
__package xz-utils
48
48
;;
49
- (alpine|centos|almalinux|eurolinux|rocky)
49
+ (alpine|centos|almalinux|eurolinux|rocky|oraclelinux )
50
50
__package xz
51
51
;;
52
52
esac
You can’t perform that action at this time.
0 commit comments