#!/bin/sh

# This script renews afsagent's tickets and tokens.
# It is called by systemd on a regular schedule.

export KRB5CCNAME=/home/afsagent/krb5cc
export KRBTKFILE=/home/afsagent/tkt

# Option #1: invoke kinit with a password
#echo "password" | /usr/bin/kinit >/dev/null daemon/scripts.mit.edu

# Option #2: invoke kinit with a keytab
/usr/bin/kinit -k -t /etc/daemon.keytab daemon/scripts.mit.edu

# Obtain AFS tokens
/usr/bin/aklog
/usr/bin/aklog -c sipb
/usr/bin/aklog -c csail
