summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleksii Vilchanskyi2017-11-15 09:22:32 +0100
committerOleksii Vilchanskyi2017-11-15 09:22:32 +0100
commitbdb7243f5eb352a06a2ca0f18f14e1dcf37c32ac (patch)
tree6996a041e2e6e3cd3a61d7353f0e1e2381e91b96
parentac78425f96689eb2a5a48dc0b605efa5adba7bb4 (diff)
downloadaur-bdb7243f5eb352a06a2ca0f18f14e1dcf37c32ac.tar.gz
Do not enable & start the daemon by default
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD2
-rwxr-xr-xckb-next.install56
3 files changed, 40 insertions, 20 deletions
diff --git a/.SRCINFO b/.SRCINFO
index bef4ee2572b6..dd0ef8d84bb5 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = ckb-next
pkgdesc = Corsair Keyboard and Mouse Input Driver, release version
pkgver = 0.2.8
- pkgrel = 4
+ pkgrel = 5
url = https://github.com/mattanger/ckb-next
install = ckb-next.install
arch = i686
diff --git a/PKGBUILD b/PKGBUILD
index fe6788582fae..3a2cc0408424 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
pkgname=ckb-next
pkgver=0.2.8
-pkgrel=4
+pkgrel=5
pkgdesc="Corsair Keyboard and Mouse Input Driver, release version"
arch=('i686' 'x86_64')
url="https://github.com/mattanger/ckb-next"
diff --git a/ckb-next.install b/ckb-next.install
index 542c3f770daf..4581ce8b8352 100755
--- a/ckb-next.install
+++ b/ckb-next.install
@@ -12,40 +12,60 @@ bold="${all_off}$(tput bold)"
blue="${bold}$(tput setaf 4)"
yellow="${bold}$(tput setaf 3)"
+_as_service() {
+ cat << EOF
+
+You might want to run ckb-daemon as a systemd service:
+
+ systemctl enable ckb-daemon.service
+ systemctl start ckb-daemon.service
+
+EOF
+}
+
+_terminate_gui_daemon() {
+ msg_blue "Terminating ckb-next GUI"
+
+ killall -TERM ckb 2>/dev/null
+
+
+ msg_blue "Terminating ckb-next daemon"
+
+ running="$(systemctl is-active ckb-daemon.service)"
+ if [[ "$running" = "active" ]]; then
+ systemctl stop ckb-daemon.service
+ fi
+
+ running="$(systemctl is-enabled ckb-daemon.service)"
+ if [[ "$running" = "enabled" ]]; then
+ systemctl disable ckb-daemon.service
+ fi
+}
+
# arg 1: the new package version
post_install() {
- msg_blue "Starting and enabling ckb-next daemon..."
- systemctl daemon-reload
- systemctl start ckb-daemon
- systemctl enable ckb-daemon
+ _as_service
}
# arg 1: the new package version
# arg 2: the old package version
pre_upgrade() {
- msg_blue "Terminating ckb-next GUI..."
- killall -9 ckb
- msg_blue "Terminating ckb-next daemon..."
- systemctl daemon-reload
- systemctl stop ckb-daemon
- systemctl disable ckb-daemon
+ _terminate_gui_daemon
}
# arg 1: the new package version
# arg 2: the old package version
post_upgrade() {
- msg_blue "Starting and enabling ckb-next daemon..."
systemctl daemon-reload
- systemctl start ckb-daemon
- systemctl enable ckb-daemon
+ _as_service
}
# arg 1: the old package version
pre_remove() {
- msg_blue "Terminating ckb-next GUI..."
- killall -9 ckb
- msg_blue "Terminating ckb-next daemon..."
+ _terminate_gui_daemon
+}
+
+# arg 1: the old package version
+post_remove() {
systemctl daemon-reload
- systemctl stop ckb-daemon
- systemctl disable ckb-daemon
}