mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-02-23 11:38:16 +00:00
Add user pihole if user does not exsist
Check if user pihole exist and add if not. This will give pihole its own system user without a login or home directory that is not system dependent.
This commit is contained in:
parent
6b76270889
commit
29c593b8b0
1 changed files with 11 additions and 1 deletions
|
@ -431,6 +431,16 @@ runGravity(){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setUser(){
|
||||||
|
# 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..."
|
||||||
|
$SUDO useradd -r -s /usr/sbin/nologin pihole
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
installPihole(){
|
installPihole(){
|
||||||
checkForDependencies # done
|
checkForDependencies # done
|
||||||
|
@ -438,7 +448,7 @@ installPihole(){
|
||||||
|
|
||||||
$SUDO chown www-data:www-data /var/www/html
|
$SUDO chown www-data:www-data /var/www/html
|
||||||
$SUDO chmod 775 /var/www/html
|
$SUDO chmod 775 /var/www/html
|
||||||
$SUDO usermod -a -G www-data pi
|
$SUDO usermod -a -G www-data pihole
|
||||||
$SUDO lighty-enable-mod fastcgi fastcgi-php > /dev/null
|
$SUDO lighty-enable-mod fastcgi fastcgi-php > /dev/null
|
||||||
|
|
||||||
getGitFiles
|
getGitFiles
|
||||||
|
|
Loading…
Add table
Reference in a new issue