Skip to content

Commit

Permalink
replace accountname demo by variable, also add USERPW variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Lange committed Oct 28, 2017
1 parent ef39493 commit 1f84aa6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
4 changes: 4 additions & 0 deletions examples/simple/class/FAIBASE.var
Expand Up @@ -16,3 +16,7 @@ STOP_ON_ERROR=700

# set parameter for install_packges(8)
MAXPACKAGES=800

# a user account will be created
username=demo
USERPW='$1$kBnWcO.E$djxB128U7dMkrltJHPf6d1'
8 changes: 4 additions & 4 deletions examples/simple/scripts/CENTOS/80-misc
Expand Up @@ -2,10 +2,10 @@

error=0 ; trap "error=$((error|1))" ERR

# add a demo user account
if ! $ROOTCMD getent passwd demo ; then
$ROOTCMD adduser -c "fai demo user" demo
$ROOTCMD usermod -p "$ROOTPW" demo
# add a $username user account
if ! $ROOTCMD getent passwd $username ; then
$ROOTCMD adduser -c "first user" $username
$ROOTCMD usermod -p "$USERPW" $username
fi

# enable graphical login screen, make run level 5 as default
Expand Down
12 changes: 6 additions & 6 deletions examples/simple/scripts/DEMO/10-misc
@@ -1,6 +1,6 @@
#! /bin/bash

# (c) Thomas Lange, 2001-2013, lange@debian.org
# (c) Thomas Lange, 2001-2017, lange@debian.org

error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code

Expand All @@ -14,11 +14,11 @@ if ifclass UBUNTU; then
$ROOTCMD addgroup --system sambashare || true
fi

# add a demo user account
if ! $ROOTCMD getent passwd demo ; then
$ROOTCMD adduser --disabled-login --gecos "fai demo user" demo
$ROOTCMD usermod -p "$ROOTPW" demo
# add additional user account
if ! $ROOTCMD getent passwd $username ; then
$ROOTCMD adduser --disabled-login --gecos "first user" $username
$ROOTCMD usermod -p "$USERPW" $username
for g in $groups; do
$ROOTCMD adduser demo $g
$ROOTCMD adduser $username $g
done
fi

0 comments on commit 1f84aa6

Please sign in to comment.