initial import
This commit is contained in:
25
tor/tor.install
Normal file
25
tor/tor.install
Normal file
@@ -0,0 +1,25 @@
|
||||
post_install() {
|
||||
if ! getent group tor &>/dev/null; then
|
||||
groupadd -g 43 tor >/dev/null
|
||||
fi
|
||||
if ! getent passwd tor &>/dev/null; then
|
||||
useradd -u 43 -g tor -d /var/lib/tor -s /bin/nologin tor >/dev/null
|
||||
fi
|
||||
tor_shell=$(getent passwd tor | cut -d: -f7)
|
||||
if [ "$tor_shell" != '/bin/nologin' ]; then
|
||||
chsh -s /bin/nologin tor &>/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
post_upgrade() {
|
||||
post_install
|
||||
}
|
||||
|
||||
post_remove() {
|
||||
if getent passwd tor &>/dev/null; then
|
||||
userdel tor >/dev/null
|
||||
fi
|
||||
if getent group tor &>/dev/null; then
|
||||
groupdel tor >/dev/null
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user