mirror of
https://github.com/nmasur/dotfiles
synced 2024-12-25 05:24:52 +00:00
move calibre perms out of activations
This commit is contained in:
parent
bfa9e8fc4e
commit
5872abcc33
@ -48,18 +48,20 @@ in {
|
||||
}];
|
||||
|
||||
# Create directory and set permissions
|
||||
system.activationScripts.calibreLibrary.text = ''
|
||||
if [ ! -d "${libraryPath}" ]; then
|
||||
$DRY_RUN_CMD mkdir --parents $VERBOSE_ARG ${libraryPath}
|
||||
fi
|
||||
if [ ! "$(stat -c "%G" ${libraryPath})" = "calibre-web" ]; then
|
||||
$DRY_RUN_CMD chown $VERBOSE_ARG -R calibre-web:calibre-web ${libraryPath}
|
||||
fi
|
||||
if [ ! "$(stat -c "%a" ${libraryPath})" = "775" ]; then
|
||||
$DRY_RUN_CMD chmod $VERBOSE_ARG 0775 ${libraryPath}
|
||||
$DRY_RUN_CMD chmod $VERBOSE_ARG -R 0640 ${libraryPath}/*
|
||||
fi
|
||||
'';
|
||||
systemd.services.calibre-library = {
|
||||
requiredBy = [ "calibre-web.service" ];
|
||||
before = [ "calibre-web.service" ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
User = "root";
|
||||
};
|
||||
script = ''
|
||||
mkdir --parents ${libraryPath}
|
||||
chown -R calibre-web:calibre-web ${libraryPath}
|
||||
chmod 0775 ${libraryPath}
|
||||
chmod -R 0640 ${libraryPath}/*
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user