#!/bin/sh

set -e


if [ ! -e /etc/arkime/wise.ini ]; then
    cd /usr/lib/arkime
    ./bin/Configure --wise
fi

if ! systemctl is-active --quiet arkimewise; then
    systemctl enable arkimewise.service
    systemctl start arkimewise.service
fi

echo "Config can be changed: /etc/arkime/wise.ini"
echo "Then you will need to restart the service arkimewise."

sleep 3s

echo "Opening Web UI http://localhost:8081"
xdg-open "http://localhost:8081" 2>/dev/null >/dev/null &

