debian/postinst
changeset 326 b44dd7bad82c
parent 314 c02eae7665af
child 366 660f5631013e
equal deleted inserted replaced
324:36400dcefb67 326:b44dd7bad82c
       
     1 #!/bin/sh
       
     2 # postinst script for mercurial-server
       
     3 
       
     4 set -e
       
     5 
       
     6 # Load debconf
       
     7 . /usr/share/debconf/confmodule
       
     8 
       
     9 case "$1" in
       
    10     configure|reconfigure)
       
    11         if ! getent passwd hg >/dev/null; then
       
    12             adduser --disabled-password --quiet --system \
       
    13                 --shell /bin/sh --group \
       
    14                 --home /var/lib/mercurial-server \
       
    15                 --gecos "Mercurial repositories" hg
       
    16             # Make sure Mercurial's modules will work when we come to use them
       
    17             update-python-modules -p
       
    18             su -c "/usr/share/mercurial-server/init/hginit /usr/share/mercurial-server" hg
       
    19         fi
       
    20     ;;
       
    21 
       
    22     abort-upgrade|abort-remove|abort-deconfigure)
       
    23     ;;
       
    24 
       
    25     *)
       
    26         echo "postinst called with unknown argument \`$1'" >&2
       
    27         exit 1
       
    28     ;;
       
    29 esac
       
    30 
       
    31 # dh_installdeb will replace this with shell code automatically
       
    32 # generated by other debhelper scripts.
       
    33 
       
    34 #DEBHELPER#
       
    35 
       
    36 exit 0