mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-22 23:08:07 +00:00
Refactor and rename create_pihole_user
. Now to actually use the user created...
This commit is contained in:
parent
25cbf4cb35
commit
bad7a08804
@ -721,15 +721,10 @@ runGravity() {
|
||||
/opt/pihole/gravity.sh
|
||||
}
|
||||
|
||||
setUser(){
|
||||
create_pihole_user(){
|
||||
# Check if user pihole exists and create if not
|
||||
echo "::: Checking if user 'pihole' exists..."
|
||||
if id -u pihole > /dev/null 2>&1; then
|
||||
echo "::: User 'pihole' already exists"
|
||||
else
|
||||
echo "::: User 'pihole' doesn't exist. Creating..."
|
||||
useradd -r -s /usr/sbin/nologin pihole
|
||||
fi
|
||||
id -u pihole &> /dev/null && echo "::: User 'pihole' already exists" || echo "::: User 'pihole' doesn't exist. Creating..."; useradd -r -s /usr/sbin/nologin pihole
|
||||
}
|
||||
|
||||
configureFirewall() {
|
||||
@ -768,7 +763,7 @@ finalExports() {
|
||||
|
||||
installPihole() {
|
||||
# Install base files and web interface
|
||||
setUser
|
||||
create_pihole_user
|
||||
if [ ! -d "/var/www/html" ]; then
|
||||
mkdir -p /var/www/html
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user