diff options
-rw-r--r-- | pcr/openrc-desktop/10-openrc-status | 35 | ||||
-rw-r--r-- | pcr/openrc-desktop/PKGBUILD | 54 |
2 files changed, 62 insertions, 27 deletions
diff --git a/pcr/openrc-desktop/10-openrc-status b/pcr/openrc-desktop/10-openrc-status new file mode 100644 index 000000000..ba4a50f17 --- /dev/null +++ b/pcr/openrc-desktop/10-openrc-status @@ -0,0 +1,35 @@ +#!/bin/sh +# Copyright (c) 2012 Alexandre Rostovtsev +# Released under the 2-clause BSD license. + +# Ensures that the NetworkManager OpenRC service is marked as started and +# providing net only when it has a successful connection. + +if [ ! -e "/run/openrc/softlevel" ]; then + # OpenRC is not running + exit 0 +fi + +# Ensure rc-service is in PATH +PATH="${PATH}:/usr/bin:/usr/bin" + +# Exit if the NetworkManager OpenRC service is not running +rc-service NetworkManager status 2>&1 | grep -Eq "status: (starting|started|inactive|stopping)" || exit 0 + +# Call rc-service in background mode so that the start/stop functions update +# NetworkManager service status to started or inactive instead of actually +# starting or stopping the daemon +export IN_BACKGROUND=YES + +case "$2" in + up) nm-online -t 0 -x || + ! rc-service NetworkManager status 2>&1 | grep -q started && + exec rc-service NetworkManager start ;; + down) nm-online -t 0 -x || + rc-service NetworkManager status 2>&1 | grep -q stopped || + exec rc-service NetworkManager stop ;; + pre-sleep) rc-service NetworkManager status 2>&1 | grep -q stopped || + exec rc-service NetworkManager stop ;; +esac +exit 0 +# vim: set ts=4: diff --git a/pcr/openrc-desktop/PKGBUILD b/pcr/openrc-desktop/PKGBUILD index a55f8ed5f..65ce1ad6c 100644 --- a/pcr/openrc-desktop/PKGBUILD +++ b/pcr/openrc-desktop/PKGBUILD @@ -15,7 +15,7 @@ pkgname=('acpid-openrc' 'networkmanager-openrc' 'wpa_supplicant-openrc') -pkgver=20160623 +pkgver=20170305 pkgrel=1 pkgdesc="OpenRC init scripts" arch=('any') @@ -34,7 +34,7 @@ source=("acpid.confd::${_url}/sys-power/acpid/files/acpid-2.0.16-conf.d" "${_url}/x11-apps/xinit/files/startDM.sh" "gpm.confd::${_url}/sys-libs/gpm/files/gpm.conf.d" "gpm.initd::${_url}/sys-libs/gpm/files/gpm.rc6-2" - "rfcomm.confd::${_url}/net-wireless/bluez/files/rfcomm-conf.d" +# "rfcomm.confd::${_url}/net-wireless/bluez/files/rfcomm-conf.d" "rfcomm.initd::${_url}/net-wireless/bluez/files/rfcomm-init.d-r2" "bluetooth.initd::${_url}/net-wireless/bluez/files/bluetooth-init.d-r3" "wpa_supplicant.confd::${_url}/net-wireless/wpa_supplicant/files/wpa_supplicant-conf.d" @@ -43,40 +43,40 @@ source=("acpid.confd::${_url}/sys-power/acpid/files/acpid-2.0.16-conf.d" "cgproxy.initd::${_url}/app-admin/cgmanager/files/cgproxy.initd-r1" "cgmanager.initd::${_url}/app-admin/cgmanager/files/cgmanager.initd-r1" "NetworkManager.confd::${_url}/net-misc/networkmanager/files/conf.d.NetworkManager" - "NetworkManager.initd::${_url}/net-misc/networkmanager/files/init.d.NetworkManager" - "10-openrc-status::${_url}/net-misc/networkmanager/files/10-openrc-status-r4" + "NetworkManager.initd::${_url}/net-misc/networkmanager/files/init.d.NetworkManager-r1" + #"10-openrc-status::${_url}/net-misc/networkmanager/files/10-openrc-status-r4" + '10-openrc-status' 'avahi-daemon.initd' 'avahi-dnsconfd.initd' 'xdg-user-dirs') sha256sums=('3755d4eb8bb64a1304e5defedb949305ac550565da36fe4f94d5f31beee821ba' - '9b8785324a5e259f10ec5aff20ef3d977621a9c1dad49751dbc7b83243cac67f' + '5dcf5721a129b3782c13fc453853c390c34e2ad4ee00706388ce014454b063ee' 'd1c55400b701a72dcb8bb85e016b5013fa3eb6a2766ffc20dae278d0ee4c1a43' - '38d2541fe00c181ff840a83927d7c37ada6a14eaac1d030aecc565ce4c6e4398' - 'e4787d99bdda938d67e9dea2148df1e19e12d2679b2f6910728dfbf0a4f6b18e' + 'cf67ba1c4bd13cc6fafdebab40b3e84d09f5b6ec768ed2dcf0ec53d9be296ba4' + 'c5e8db4e9d390bcaebcf203127a99b16d888a576d873920bd42dc56d20fa90c8' '9d26b72bb28611a60a6b9f942b8d8cfe47b59f926be89af9709b5912668344d8' - '89728c129014a9ddcd0607da207be91d7b40f22541db51e0e8d22b8d110c40f5' - '5985efb5e707b1817b4452410068a322a4db2a00ee0f84e41f3b35b31b9b4dd5' - 'da3efeaa0e5becefbbd5fe82e89a76a1efa1969b9afc1b5bd0abf83a93fc0bee' + '2ae57ee506eeb15eaa8f06b6a8f1d29fd007e33558c506bbf7640d16c4a67d50' + 'e37a9353ed848f35ac7b07d1398466a18741fd1de075a6cb971e1c28088d791d' + 'f343f87c5c89aa1b7112ec946c4df06b25e541d488405f4d98bedbeddd30bd32' '73e7483fdc4b12ab4225a4cb13bbe7da71b07b9e69b17e3a6a4c63cb5e2287c8' - '4a82dd5b8c1c04a70c477d9a376268a4fbbda097799bb70d7fabb937bdb09a14' - '672498957049fd301f9c9c1dc9fa49430e5e6d3c3f1f3cdce80df3af7d425d08' - 'b789ffce96adc743fc6811cabcb7b8d10b8224d05a6fe465ba6ddbba017c7018' - 'd19ac0371fc1aab6ad9002476fdd239584ee4fe7e3d25f9fe68826262b708999' + 'b48fd8ef0c4e64ca3f3ada72e8e2148a276f86bf3cbb1a165504058bd15385c1' + '0bd7f4a3e05c781f4cd24ef7d6702fbd7e621100bcd1e281f0ee15bb134f96b5' + 'e42a9bef5fb34bfcbab223189a416e7be220009aaef36d26b39c664655b2971c' '61ec59007f66ac5bacc0aa095d1f2ccbc977a687038e161a463d1727223d5a90' '98985142371d39ea6294d757e85a3d3fc9fc21718063afbf81869e1d2ca648a7' - 'fb3483d4e54d3b48b993e117e45338977a5782373520e15d51cd9cd9417eec03' - '5e676e1bd76f73a1fd48f706030b8cc0bea5cb36c439dd02f213092ca985cd9e' - '625c8b2f507076eac0108e75547239508d147bcc669372fc3991bb42b17608e1' + 'f3aa34b99a90213c53496f8ea014c487266338791f3526043a7fd97adc651fc6' + '97220fa0af6dcaa9d2cb726620ee3de8e216e55bab37cea40e5ed010ed637e35' + 'f162685428a6593630daf5d636c198caf4992843ced977dc6d7288b7559a062c' '4594573f01fe5e04b6dde4525796acf909158591bdcefd662ec23fe0d1c3e1bd' - '1af8436d6e917708ef310498c57272229e3f149cc7305281fb647c1e03fb952c' - 'f8ed424818b866a0bf882c569f4484e8b1485ce7ac8c472f060fd877f2dcfe65' + '99bd8af8573b8b4ca64e818ef312ce6094f05ed5829712203fd4a12b98f39650' + '1535237db113a76261d6f1ce0b24a55e956934b0c1c59e9fd624f621961327b6' '876788303553fe773e64917f76f0208f5e8adf7b91d4af24aa9d6a68a147d646' 'e128576d72981e402ff106bb481108ab6d5ba941ab1b0f5f53e96a7831fc1d15' 'f0f27de23d849b2fa4ebf59e448b5a843b577d14dc2c1070e228999091fa7f5e') -#pkgver() { -# date +%Y%m%d -#} +pkgver() { + date +%Y%m%d +} _inst_initd(){ install -Dm755 ${srcdir}/$1.initd ${pkgdir}/etc/init.d/$1 @@ -174,18 +174,18 @@ package_networkmanager-openrc() { install -Dm755 "${srcdir}/10-openrc-status" "${pkgdir}/etc/NetworkManager/dispatcher.d/10-openrc-status" - sed -e 's|@EPREFIX@/sbin|/usr/bin|' \ - -e 's|@EPREFIX@/usr/sbin|/usr/bin|' \ - -i "${pkgdir}/etc/NetworkManager/dispatcher.d/10-openrc-status" +# sed -e 's|@EPREFIX@/sbin|/usr/bin|' \ +# -e 's|@EPREFIX@/usr/sbin|/usr/bin|' \ +# -i "${pkgdir}/etc/NetworkManager/dispatcher.d/10-openrc-status" } package_bluez-openrc() { pkgdesc="OpenRC bluez init script" groups=('openrc-mobile') depends=('bluez' 'dbus-openrc') - backup=('etc/conf.d/rfcomm') + #backup=('etc/conf.d/rfcomm') - _inst_confd 'rfcomm' +# _inst_confd 'rfcomm' _inst_initd 'rfcomm' _inst_initd 'bluetooth' |