~ubuntu-branches/ubuntu/precise/ubuntustudio-meta/precise

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/python

import changesettings
from optparse import OptionParser

#Instance the option parser
parser = OptionParser()
parser.add_option('-i', '--install', action='store_true', dest='install', help="Install the rtprio setting")
parser.add_option('-r', '--remove', action="store_true", dest='remove', help="Remove the rtprio setting")
(options, args) = parser.parse_args()

#Instance the setting we want to change
rtprio = changesettings.ChangeSettings('/etc/security/limits.conf', '@audio\s*-\s*rtprio\s*\d*', '@audio          -       rtprio          99\n')

if options.install:
  rtprio.ch_setting()
elif options.remove:
  rtprio.rm_setting()