#!/bin/sh

if [ -x /sbin/setcap ]; then
  bin=(
  alsa_in alsa_out jack_alias jack_bufsize jack_connect jack_cpu
  jack_cpu_load jack_evmon jack_freewheel jack_iodelay jack_latent_client
  jack_load jack_lsp jack_metro jack_midi_dump jack_midi_latency_test
  jack_midiseq jack_midisine jack_monitor_client jack_multiple_metro
  jack_net_master jack_net_slave jack_netsource jack_property jack_rec
  jack_samplerate jack_server_control jack_session_notify jack_showtime
  jack_simdtests jack_simple_client jack_simple_session_client jack_test
  jack_thru jack_transport jack_unload jack_wait jack_zombie jackd)

  for i in ${bin[@]}; do
    /sbin/setcap cap_ipc_lock,cap_sys_nice=ep usr/bin/$i
  done
fi
