#!/usr/bin/env bash

if [ ! -d /data/zpush ]; then
   echo -e "\t\t\033[1;33m* initalizing Z-Push working directory\033[0m"
   mkdir /data/zpush
fi

if [ ! -d /data/log/z-push ]; then
   echo -e "\t\t\033[1;33m* initalizing Z-Push log directory\033[0m"
   mkdir /data/log/z-push
fi

chown www-data:www-data -R /data/zpush
chown www-data:www-data -R /data/log/z-push

ln -s /data/zpush /var/lib/z-push 2> /dev/null

# /opt/z-push/z-push-admin.php -a fixstates > /dev/null # update from 2.2