mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Merge pull request #242 from ChadBHowell/CBH---pihole-system-user-v2
Add user pihole if user does not exsist
This commit is contained in:
commit
3e7ecda80f
1 changed files with 11 additions and 1 deletions
|
@ -543,6 +543,16 @@ runGravity() {
|
||||||
/usr/local/bin/gravity.sh
|
/usr/local/bin/gravity.sh
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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() {
|
||||||
# Install base files and web interface
|
# Install base files and web interface
|
||||||
|
@ -551,7 +561,7 @@ installPihole() {
|
||||||
$SUDO mkdir -p /etc/pihole/
|
$SUDO mkdir -p /etc/pihole/
|
||||||
$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…
Reference in a new issue