functions-users.sh (211730) | functions-users.sh (217234) |
---|---|
1#!/bin/sh 2#- 3# Copyright (c) 2010 iXsystems, Inc. All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions 7# are met: 8# 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24# SUCH DAMAGE. 25# | 1#!/bin/sh 2#- 3# Copyright (c) 2010 iXsystems, Inc. All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions 7# are met: 8# 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24# SUCH DAMAGE. 25# |
26# $FreeBSD: head/usr.sbin/pc-sysinstall/backend/functions-users.sh 211730 2010-08-24 06:11:46Z imp $ | 26# $FreeBSD: head/usr.sbin/pc-sysinstall/backend/functions-users.sh 217234 2011-01-10 19:57:18Z jpaetzel $ |
27 28# Functions which runs commands on the system 29 30. ${BACKEND}/functions.sh 31. ${BACKEND}/functions-parse.sh 32 33 34# Function which checks and sets up auto-login for a user if specified --- 53 unchanged lines hidden (view full) --- 88 89 echo $line | grep "^userPass=" >/dev/null 2>/dev/null 90 if [ "$?" = "0" ] 91 then 92 get_value_from_string "${line}" 93 USERPASS="$VAL" 94 fi 95 | 27 28# Functions which runs commands on the system 29 30. ${BACKEND}/functions.sh 31. ${BACKEND}/functions-parse.sh 32 33 34# Function which checks and sets up auto-login for a user if specified --- 53 unchanged lines hidden (view full) --- 88 89 echo $line | grep "^userPass=" >/dev/null 2>/dev/null 90 if [ "$?" = "0" ] 91 then 92 get_value_from_string "${line}" 93 USERPASS="$VAL" 94 fi 95 |
96 echo $line | grep "^userEncPass=" >/dev/null 2>/dev/null 97 if [ "$?" = "0" ] 98 then 99 get_value_from_string "${line}" 100 USERENCPASS="$VAL" 101 fi 102 |
|
96 echo $line | grep "^userShell=" >/dev/null 2>/dev/null 97 if [ "$?" = "0" ] 98 then 99 get_value_from_string "${line}" 100 strip_white_space "$VAL" 101 USERSHELL="$VAL" 102 fi 103 --- 26 unchanged lines hidden (view full) --- 130 then 131 ARGS="${ARGS} -c \"${USERCOMMENT}\"" 132 fi 133 134 if [ ! -z "${USERPASS}" ] 135 then 136 ARGS="${ARGS} -h 0" 137 echo "${USERPASS}" >${FSMNT}/.tmpPass | 103 echo $line | grep "^userShell=" >/dev/null 2>/dev/null 104 if [ "$?" = "0" ] 105 then 106 get_value_from_string "${line}" 107 strip_white_space "$VAL" 108 USERSHELL="$VAL" 109 fi 110 --- 26 unchanged lines hidden (view full) --- 137 then 138 ARGS="${ARGS} -c \"${USERCOMMENT}\"" 139 fi 140 141 if [ ! -z "${USERPASS}" ] 142 then 143 ARGS="${ARGS} -h 0" 144 echo "${USERPASS}" >${FSMNT}/.tmpPass |
145 elif [ ! -z "${USERENCPASS}" ] 146 then 147 ARGS="${ARGS} -H 0" 148 echo "${USERENCPASS}" >${FSMNT}/.tmpPass |
|
138 else 139 ARGS="${ARGS} -h -" 140 rm ${FSMNT}/.tmpPass 2>/dev/null 2>/dev/null 141 fi 142 143 if [ ! -z "${USERSHELL}" ] 144 then 145 ARGS="${ARGS} -s \"${USERSHELL}\"" --- 9 unchanged lines hidden (view full) --- 155 if [ ! -z "${USERGROUPS}" ] 156 then 157 ARGS="${ARGS} -G \"${USERGROUPS}\"" 158 fi 159 160 add_user "${ARGS}" 161 162 # Unset our vars before looking for any more users | 149 else 150 ARGS="${ARGS} -h -" 151 rm ${FSMNT}/.tmpPass 2>/dev/null 2>/dev/null 152 fi 153 154 if [ ! -z "${USERSHELL}" ] 155 then 156 ARGS="${ARGS} -s \"${USERSHELL}\"" --- 9 unchanged lines hidden (view full) --- 166 if [ ! -z "${USERGROUPS}" ] 167 then 168 ARGS="${ARGS} -G \"${USERGROUPS}\"" 169 fi 170 171 add_user "${ARGS}" 172 173 # Unset our vars before looking for any more users |
163 unset USERNAME USERCOMMENT USERPASS USERSHELL USERHOME USERGROUPS | 174 unset USERNAME USERCOMMENT USERPASS USERENCPASS USERSHELL USERHOME USERGROUPS |
164 else 165 exit_err "ERROR: commitUser was called without any userName= entry!!!" 166 fi 167 fi 168 169 done <${CFGF} 170 171 172 # Check if we need to enable a user to auto-login to the desktop 173 check_autologin 174 175}; | 175 else 176 exit_err "ERROR: commitUser was called without any userName= entry!!!" 177 fi 178 fi 179 180 done <${CFGF} 181 182 183 # Check if we need to enable a user to auto-login to the desktop 184 check_autologin 185 186}; |