summarylogtreecommitdiffstats
path: root/whatpulse.install
blob: 1620255d6ef150dfc9811dfd1a445d29a3168834 (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
31
32
33
34
post_install() {
    # Create the 'input' group
    if [ -n "`cat /etc/group | grep -e ^input:`" ] ; then
        echo "Group 'input' already exists!"
    else
        groupadd input
        echo "Created group 'input'."
    fi
    # Manage permissions for the binary
    setcap cap_net_raw,cap_net_admin=eip /usr/bin/whatpulse

    # Display some information about how to set-up permissions
    cat <<__EOF__
==> Now add your user to the 'input' group:
==> # gpasswd -a USERNAME input
==>
==> Now reboot to fix the input permissions, or execute this:
==> # find /dev/input/ -iname "event*" -exec chmod 644 {} \;
==> 
==> This temporarily grants everybody read permissions on
==>   all input devices, something you should obviously avoid if
==>   you fear somebody will eavesdrop those input devices.
__EOF__
}

post_upgrade() {
    # Manage permissions for the binary
    setcap cap_net_raw,cap_net_admin=eip /usr/bin/whatpulse
}

pre_remove() {
    # Warn the user about the 'input' group
    echo "The \"input\" group still exists, remove it if you don't use it anymore."
}