diff options
author | Peter Palfrader <peter@palfrader.org> | 2004-01-13 13:40:00 +0000 |
---|---|---|
committer | Peter Palfrader <peter@palfrader.org> | 2004-01-13 13:40:00 +0000 |
commit | 9d3cf1b4d1884d7f7e0ea39bc9fe8eae481647a2 (patch) | |
tree | f8abee2a51977b150260bfb7699a4c94b6bc6bb7 /debian/tor.postinst | |
parent | 793c65e60fa0cf4be6cde6b6011d12291e92a969 (diff) | |
download | tor-9d3cf1b4d1884d7f7e0ea39bc9fe8eae481647a2.tar tor-9d3cf1b4d1884d7f7e0ea39bc9fe8eae481647a2.tar.gz |
First go at a debian package
svn:r987
Diffstat (limited to 'debian/tor.postinst')
-rw-r--r-- | debian/tor.postinst | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/debian/tor.postinst b/debian/tor.postinst new file mode 100644 index 000000000..cd2e91bee --- /dev/null +++ b/debian/tor.postinst @@ -0,0 +1,54 @@ +#!/bin/sh -e + +# checking debian-tor account + +uid=`getent passwd debian-tor | cut -d ":" -f 3` +home=`getent passwd debian-tor | cut -d ":" -f 6` + +# if there is the uid the account is there and we can do +# the sanit(ar)y checks otherwise we can safely create it. + +if [ "$uid" ]; then + # guess??? the checks!!! + if [ $uid -ge 100 ] && [ $uid -le 999 ]; then + echo "debian-tor uid check: ok" + else + echo "ERROR: debian-tor account has a non-system uid!" + echo "Please check /usr/share/doc/tor/README.Debian on how to" + echo "correct this problem" + exit 1 + fi + if [ "$home" = "/var/lib/tor" ]; then + echo "debian-tor homedir check: ok" + else + echo "ERROR: debian-tor account has an invalid home directory!" + echo "Please check /usr/share/doc/tor/README.Debian on how to" + echo "correct this problem" + exit 1 + fi +else + # what this might mean?? oh creating a system l^Huser! + adduser --quiet \ + --system \ + --disabled-password \ + --home /var/lib/tor \ + --no-create-home \ + --shell /bin/bash \ + --group \ + debian-tor +fi + +# ch{owning,moding} things around +# We will do nothing across upgrades. + +if [ "$2" = "" ]; then + for i in lib log run; do + chown -R debian-tor:debian-tor /var/$i/tor + chmod -R 700 /var/$i/tor + find /var/$i/tor -type f -exec chmod 600 '{}' ';' + done +fi + +#DEBHELPER# + +exit 0 |