diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-11-07 19:27:23 -0600 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-11-07 19:27:23 -0600 |
commit | 007eed6403d77bbfc4164114875ce6253aff7ab4 (patch) | |
tree | adc3085a95a003d2430947b0acc3d9cd7097e431 /hscript/script_e.cc | |
parent | f6c45bc408a9afc02d733b69877c17c5941e8019 (diff) | |
download | horizon-007eed6403d77bbfc4164114875ce6253aff7ab4.tar.gz horizon-007eed6403d77bbfc4164114875ce6253aff7ab4.tar.bz2 horizon-007eed6403d77bbfc4164114875ce6253aff7ab4.tar.xz horizon-007eed6403d77bbfc4164114875ce6253aff7ab4.zip |
hscript: Implement Runner.Execute.UserAccounts, add tests
Diffstat (limited to 'hscript/script_e.cc')
-rw-r--r-- | hscript/script_e.cc | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/hscript/script_e.cc b/hscript/script_e.cc index 24b66ef..85c43d3 100644 --- a/hscript/script_e.cc +++ b/hscript/script_e.cc @@ -481,7 +481,26 @@ bool Script::execute() const { EXECUTE_OR_FAIL("keymap", internal->keymap) } - /* UserAccounts */ + for(auto &acct : internal->accounts) { + output_info("internal", "setting up user account " + acct.first); + + EXECUTE_OR_FAIL("username", acct.second->name) + if(acct.second->alias) { + EXECUTE_OR_FAIL("useralias", acct.second->alias) + } + if(acct.second->passphrase) { + EXECUTE_OR_FAIL("userpw", acct.second->passphrase) + } + if(!acct.second->groups.empty()) { + for(auto &grp : acct.second->groups) { + EXECUTE_OR_FAIL("usergroups", grp) + } + } + if(acct.second->icon) { + EXECUTE_OR_FAIL("usericon", acct.second->icon) + } + } + EXECUTE_OR_FAIL("timezone", internal->tzone) output_step_end("post-metadata"); |