summaryrefslogtreecommitdiff
path: root/templates/system/login/user/node.def
blob: a04e990f0c53216fc740877a85f92c0f1e393c75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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 && \
sudo /opt/vyatta/sbin/vyatta_update_login_user.pl \
  '$(@)' '$(full-name/@)' '$(authentication/encrypted-password/@)' \
  '$(level/@)'"
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 \
  if ! sudo /opt/vyatta/sbin/vyatta_update_login_user.pl -d '$(@)'; then \
    rm -rf /tmp/vyatta-delete-system-login-user-$(@).\\\$PPID; \
    exit 1; \
  fi; \
else \
  exit 1; \
fi"