mirror of
https://github.com/libretro/Lakka-LibreELEC.git
synced 2025-04-04 05:45:20 +00:00
config/functions: match user only at beginning of line
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user