mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-08 23:20:56 +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
|
/opt/pihole/gravity.sh
|
||||||
}
|
}
|
||||||
|
|
||||||
setUser(){
|
create_pihole_user(){
|
||||||
# Check if user pihole exists and create if not
|
# Check if user pihole exists and create if not
|
||||||
echo "::: Checking if user 'pihole' exists..."
|
echo "::: Checking if user 'pihole' exists..."
|
||||||
if id -u pihole > /dev/null 2>&1; then
|
id -u pihole &> /dev/null && echo "::: User 'pihole' already exists" || echo "::: User 'pihole' doesn't exist. Creating..."; useradd -r -s /usr/sbin/nologin pihole
|
||||||
echo "::: User 'pihole' already exists"
|
|
||||||
else
|
|
||||||
echo "::: User 'pihole' doesn't exist. Creating..."
|
|
||||||
useradd -r -s /usr/sbin/nologin pihole
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
configureFirewall() {
|
configureFirewall() {
|
||||||
@ -768,7 +763,7 @@ finalExports() {
|
|||||||
|
|
||||||
installPihole() {
|
installPihole() {
|
||||||
# Install base files and web interface
|
# Install base files and web interface
|
||||||
setUser
|
create_pihole_user
|
||||||
if [ ! -d "/var/www/html" ]; then
|
if [ ! -d "/var/www/html" ]; then
|
||||||
mkdir -p /var/www/html
|
mkdir -p /var/www/html
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user