diff --git a/bundles/users/files/bashrc b/bundles/users/files/bashrc index 6bcdcd2..02a9c02 100644 --- a/bundles/users/files/bashrc +++ b/bundles/users/files/bashrc @@ -64,3 +64,8 @@ ${k}() { ${v} } % endfor + +if [[ -f "/etc/bashrc_bundlewrap/$(logname)" ]] +then + source "/etc/bashrc_bundlewrap/$(logname)" +fi diff --git a/bundles/users/items.py b/bundles/users/items.py index d6df3cd..79590dc 100644 --- a/bundles/users/items.py +++ b/bundles/users/items.py @@ -1,5 +1,9 @@ from os.path import exists, join +directories['/etc/bashrc_bundlewrap'] = { + 'purge': True, +} + files = { '/etc/bash.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))): - files[home + '/.bashrc'] = { + files[f'/etc/bashrc_bundlewrap/{username}'] = { 'content_type': 'mako', 'source': 'bash/{}.bashrc'.format(username), } - else: - files[home + '/.bashrc'] = { - 'delete': True, - } + files[f"{home}/.bashrc"] = { + 'delete': True, + } if attrs.get('enable_linger', False): linger_test = ''