blob: 7b9ea25487fa1e9d896aac34c37d8df1705890fa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
ALL_OFF="$(tput sgr0)"
YELLOW="${BOLD}$(tput setaf 3)"
WHITE="${BOLD}$(tput setaf 7)"
_warning_root() {
local _warning="sunshine has full root access"
printf "${YELLOW}WARNING: ${WHITE}%s${ALL_OFF}\n" "$_warning"
}
do_setcap() {
_warning_root
setcap cap_sys_admin+p $(readlink -f usr/bin/sunshine)
}
do_udev_reload() {
udevadm control --reload-rules
udevadm trigger --property-match=DEVNAME=/dev/uinput
modprobe uinput || true
}
post_install() {
do_setcap
do_udev_reload
}
post_upgrade() {
do_setcap
do_udev_reload
}
|