From d38f035f22fa2977500eb5c0cb2981f65deea377 Mon Sep 17 00:00:00 2001 From: kvaps Date: Thu, 4 May 2017 13:15:01 +0200 Subject: [PATCH] add: selinux installed check --- postinstall.one | 11 ++++++++++- src/etc/one-context.d/loc-23-selinux-ssh##rpm | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/postinstall.one b/postinstall.one index 7f9fe42..d8a03c5 100755 --- a/postinstall.one +++ b/postinstall.one @@ -32,7 +32,7 @@ then fi if [ -f /etc/init.d/one-context ]; then - if [ -d /etc/sysconfig/network-scripts ]; then + if [ -d /etc/sysconfig/network-scripts ] || [ -d /etc/sysconfig/network ]; then chkconfig --add one-context-local chkconfig --add one-context elif [ -d /etc/network ]; then @@ -79,3 +79,12 @@ if [ -d /etc/sysconfig/network-scripts ]; then rm -f /etc/sysconfig/network-scripts/ifcfg-eth* fi +# openSUSE based distros +if [ -d /etc/sysconfig/network ]; then + # Prepare network files + rm -f /etc/sysconfig/network/ifcfg-eth* + rm -f /etc/sysconfig/network/routes + sed -i '/^NETCONFIG_DNS_STATIC_SERVERS=/ s/=.*$/=""/' /etc/sysconfig/network/config + sed -i '/^NETCONFIG_DNS_STATIC_SEARCHLIST=/ s/=.*$/=""/' /etc/sysconfig/network/config +fi + diff --git a/src/etc/one-context.d/loc-23-selinux-ssh##rpm b/src/etc/one-context.d/loc-23-selinux-ssh##rpm index 164d1c1..bfc513d 100755 --- a/src/etc/one-context.d/loc-23-selinux-ssh##rpm +++ b/src/etc/one-context.d/loc-23-selinux-ssh##rpm @@ -1 +1 @@ -restorecon -R -v /root/.ssh +[ -x /sbin/restorecon ] && restorecon -R -v /root/.ssh