#!/bin/bash

if [ ! -f /etc/opt/slapcache.cfg ]; then
  slapcache-conf
fi

DFILE="/opt/upgrader/"
TFILE="archive.tar.gz"

mkdir -p $DFILE
cd $DFILE

slapcache-download --destination=$TFILE
tar -xzvf $TFILE

md5sum $TFILE > "/opt/upgrader/next-upgrader-md5sum"
