mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
config/functions: match user only at beginning of line
This commit is contained in:
parent
4c9ad98ae2
commit
dcd653b5a4
@ -365,7 +365,7 @@ add_user() {
|
||||
# Usage: add_user "username" "password" "userid" "groupid" "description" "home" "shell"
|
||||
mkdir -p ${INSTALL}/etc
|
||||
touch ${INSTALL}/etc/passwd
|
||||
if [ -z "`grep "$1:" ${INSTALL}/etc/passwd`" ]; then
|
||||
if ! grep -q "^$1:" ${INSTALL}/etc/passwd; then
|
||||
echo "$1:x:$3:$4:$5:$6:$7" >> ${INSTALL}/etc/passwd
|
||||
fi
|
||||
|
||||
@ -376,7 +376,7 @@ add_user() {
|
||||
if [ "$PASSWORD" = "x" ]; then
|
||||
PASSWORD="*"
|
||||
fi
|
||||
if [ -z "`grep "$1:" ${INSTALL}/usr/config/shadow`" ]; then
|
||||
if ! grep -q "^$1:" ${INSTALL}/usr/config/shadow; then
|
||||
echo "$1:$PASSWORD:::::::" >> ${INSTALL}/usr/config/shadow
|
||||
fi
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user