From 07183520f3f4d2f89e526055db418046d0d2450f Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Fri, 19 Oct 2007 11:26:15 -0700 Subject: move "system" configuration templates/scripts from vyatta-cfg. --- templates/system/login/user/node.def | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 templates/system/login/user/node.def (limited to 'templates/system/login/user/node.def') diff --git a/templates/system/login/user/node.def b/templates/system/login/user/node.def new file mode 100644 index 00000000..0d09c4d0 --- /dev/null +++ b/templates/system/login/user/node.def @@ -0,0 +1,17 @@ +tag: +type: txt +help: "User account information" +syntax: pattern $(@) "^[a-zA-Z_][a-zA-Z0-9_-]*\\$?$" ; "invalid user name $(@)" +# line continuation and $() expansion are done by cli, not sh. +# need mandatory encrypted password. +end: "if [ -d /tmp/vyatta-delete-system-login-user-$(@).\\\$PPID ]; \ +then rm -rf /tmp/vyatta-delete-system-login-user-$(@).\\\$PPID && exit 0; \ +fi && \ +/opt/vyatta/sbin/vyatta_update_login_user.pl \ +'$(@)' '$(full-name/@)' '$(authentication/encrypted-password/@)'" +delete: "if [ x$(@) == x ]; then exit 1; fi && \ +if [ x$(@) == xroot ]; then echo Cannot delete user \"root\" 1>&2 && exit 2; \ +fi && \ +if mkdir /tmp/vyatta-delete-system-login-user-$(@).\\\$PPID >& /dev/null; \ +then /opt/vyatta/sbin/vyatta_update_login_user.pl -d '$(@)'; \ +else exit 1; fi" -- cgit v1.2.3