mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
fix pihole user creation function
- fix stdout newlines - catch failed user creation Signed-off-by: bcambl <blayne@blaynecampbell.com>
This commit is contained in:
parent
13c393fc9d
commit
e7e03e36de
1 changed files with 7 additions and 4 deletions
|
@ -1633,15 +1633,18 @@ create_pihole_user() {
|
||||||
# If the user pihole exists,
|
# If the user pihole exists,
|
||||||
if id -u pihole &> /dev/null; then
|
if id -u pihole &> /dev/null; then
|
||||||
# just show a success
|
# just show a success
|
||||||
echo -ne "${OVER} ${TICK} ${str}"
|
echo -e "${OVER} ${TICK} ${str}"
|
||||||
# Otherwise,
|
# Otherwise,
|
||||||
else
|
else
|
||||||
echo -ne "${OVER} ${CROSS} ${str}"
|
echo -ne "${OVER} ${CROSS} ${str}"
|
||||||
local str="Creating user 'pihole'"
|
local str="Creating user 'pihole'"
|
||||||
echo -ne " ${INFO} ${str}..."
|
echo -ne "${OVER} ${INFO} ${str}..."
|
||||||
# create her with the useradd command
|
# create her with the useradd command
|
||||||
useradd -r -s /usr/sbin/nologin pihole
|
if useradd -r -s /usr/sbin/nologin pihole; then
|
||||||
echo -ne "${OVER} ${TICK} ${str}"
|
echo -e "${OVER} ${TICK} ${str}"
|
||||||
|
else
|
||||||
|
echo -e "${OVER} ${CROSS} ${str}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue