+if [[ $EUID != 0 ]]; then
+ echo "$0: error: expected to be root."
+ exit 1
+fi
+
+TPW=/q/root/shadow/traci-simple
+if ifclass tp; then
+ ROOTPW="$TPW"
+else
+ ROOTPW=/q/root/shadow/standard
+fi
+
+chpw() {
+ # generating a hashed password:
+ # under debian, you can do
+ # mkpasswd -m sha-512 -s >/q/root/shadow/standard
+ # On arch, best seems to be copy your shadow file to a temp location,
+ # then passwd, get out the new pass, then copy the shadow file back.
+
+ user=$1
+ pwfile=$2
+ if [[ $pwfile && -e $pwfile ]]; then
+ printf "$user:" | cat - "$pwfile" | $ROOTCMD chpasswd -e
+ else
+ echo "$0: warning: no pw set for $user" >&2
+ fi
+}
+au() { # add user
+ if ! $ROOTCMD getent passwd ${@: -1}; then
+ $ROOTCMD useradd -m -s /bin/bash $@
+ fi
+}