bundles/users: source users bashrc after loading global bashrc instead of overwriting it
This commit is contained in:
parent
c02a1f2a90
commit
dcb9db3639
2 changed files with 13 additions and 5 deletions
|
@ -64,3 +64,8 @@ ${k}() {
|
||||||
${v}
|
${v}
|
||||||
}
|
}
|
||||||
% endfor
|
% endfor
|
||||||
|
|
||||||
|
if [[ -f "/etc/bashrc_bundlewrap/$(logname)" ]]
|
||||||
|
then
|
||||||
|
source "/etc/bashrc_bundlewrap/$(logname)"
|
||||||
|
fi
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
from os.path import exists, join
|
from os.path import exists, join
|
||||||
|
|
||||||
|
directories['/etc/bashrc_bundlewrap'] = {
|
||||||
|
'purge': True,
|
||||||
|
}
|
||||||
|
|
||||||
files = {
|
files = {
|
||||||
'/etc/bash.bashrc': {
|
'/etc/bash.bashrc': {
|
||||||
'source': 'bashrc',
|
'source': 'bashrc',
|
||||||
|
@ -64,14 +68,13 @@ for username, attrs in node.metadata['users'].items():
|
||||||
}
|
}
|
||||||
|
|
||||||
if exists(join(repo.path, 'data', 'users', 'files', 'bash', '{}.bashrc'.format(username))):
|
if exists(join(repo.path, 'data', 'users', 'files', 'bash', '{}.bashrc'.format(username))):
|
||||||
files[home + '/.bashrc'] = {
|
files[f'/etc/bashrc_bundlewrap/{username}'] = {
|
||||||
'content_type': 'mako',
|
'content_type': 'mako',
|
||||||
'source': 'bash/{}.bashrc'.format(username),
|
'source': 'bash/{}.bashrc'.format(username),
|
||||||
}
|
}
|
||||||
else:
|
files[f"{home}/.bashrc"] = {
|
||||||
files[home + '/.bashrc'] = {
|
'delete': True,
|
||||||
'delete': True,
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if attrs.get('enable_linger', False):
|
if attrs.get('enable_linger', False):
|
||||||
linger_test = ''
|
linger_test = ''
|
||||||
|
|
Loading…
Reference in a new issue