Last active
August 29, 2015 14:25
-
-
Save raphink/2af3b0cd2a7f5f37fa31 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?><tomcat-users><role rolename="manager"></role> | |
<user username="tcadmin" password="password" roles="manager"></user> | |
</tomcat-users> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/augtool -Asf | |
transform Xml.lns incl /tmp/test.xml | |
load | |
set /augeas/context /files/tmp/test.xml | |
# header | |
set "#declaration/#attribute/version" "1.0" | |
set "#declaration/#attribute/encoding" "utf-8" | |
# role | |
set tomcat-users/role[#attribute/rolename="manager"]/#attribute/rolename "manager" | |
# user | |
defnode user tomcat-users/user[#attribute/username="tcadmin"] | |
set $user/#attribute/username "tcadmin" | |
set $user/#attribute/password "password" | |
set $user/#attribute/roles "manager" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment