Quote:
Originally Posted by kovidgoyal
You should write a python script for that, not bash, it will be easier. Something like:
Code:
import subprocess
users = tuple(filter(None, open('users.txt').read().splitlines()))
if users:
subprocess.check_call('systemctl stop calibre-server'.split())
for user in users:
username, password = user.split()
subprocess.check_call(['calibre-server', '--manage-users', '--', 'add', username, password])
subprocess.check_call('systemctl start calibre-server')
|

This is exactly what I am up to, python surely makes things much easier
In your code i can see you use "-- add" with a space. Is there any documentation on how to edit library restrictions and prompt read-only access? I want to suppress the dialog and input it thru one or a series of commands like what you did there.
Thank you in advance