Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
16bac47
commit a28f19c
Showing
30 changed files
with
899 additions
and
826 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule hostsblock
deleted from
214fec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
add_user_group() { | ||
_changed=0 | ||
if getent passwd | grep -q "^hostsblock:"; then | ||
true | ||
else | ||
_changed=1 | ||
useradd -d /var/lib/hostsblock -c "hostsblock" -m -U hostsblock | ||
fi | ||
if getent group | grep -q "^hostsblock:"; then | ||
true | ||
else | ||
_changed=1 | ||
groupadd hostsblock | ||
fi | ||
if [ $_changed == 1 ]; then | ||
gpasswd -a hostsblock hostsblock | ||
gpasswd -A hostsblock hostsblock | ||
chmod 750 /var/lib/hostsblock | ||
chmod -R 640 /var/lib/hostsblock/* | ||
chown -R hostsblock:hostsblock /var/lib/hostsblock | ||
fi | ||
} | ||
post_install() { | ||
add_user_group | ||
|
||
cat << EOF | ||
As of 0.999.4, hostsblock requires additional sudo permissions. | ||
Please see https://github.com/gaenserich/hostsblock for details. | ||
EOF | ||
} | ||
|
||
post_upgrade() { | ||
add_user_group | ||
|
||
cat << EOF | ||
As of 0.999.4, hostsblock requires additional sudo permissions. | ||
Please see https://github.com/gaenserich/hostsblock for details. | ||
EOF | ||
} | ||
|
||
post_remove() { | ||
userdel hostsblock | ||
groupdel hostsblock | ||
cat << EOF | ||
hostsblock's configuration and cache directory (/var/lib/hostsblock) has not been removed. | ||
|
||
You should now remove the entries you put into sudoers (via sudo visudo) for hostsblock. | ||
EOF |
Oops, something went wrong.