pre_install() {
    /bin/true
}

post_install() {
    groupadd -g 86 radiusd
    useradd -g radiusd -u 86 -s /bin/false radiusd

    chown -R radiusd:radiusd /var/log/radius
    chown -R radiusd:radiusd /var/run/radiusd


    echo "++++++++++++++++++++ Warning ++++++++++++++++++++++"
    echo "| You need to create certificates before running  |"
    echo "| radiusd daemon.                                 |"
    echo "| To create certificates, do the following as root|"    
    echo "| cd /etc/raddb/certs                             |"                            
    echo "| make                                            |"
    echo "| chown -R radiusd:radiusd /etc/raddb/certs       |"
    echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
    /bin/true
}

pre_upgrade() {
    /bin/true
}

post_upgrade() {
    /bin/true
}

pre_remove() {
    if [ -f /var/run/daemons/radiusd ]; then 
        /etc/rc.d/radiusd stop
    fi
    /bin/true
}

post_remove() {
    userdel radiusd
    groupdel radiusd
    /bin/true
}

