#!/bin/bash

if [ -f "/unas/sbin/webfile/webfile.py" ];then
    WEBFILE="python3 /unas/sbin/webfile/webfile.py"
elif [ -f "/unas/sbin/webfile/webfile.pyc" ];then
    WEBFILE="python3 /unas/sbin/webfile/webfile.pyc"
else
    exit 255
fi

if [ -z "$DEBUG" ];then
    log_file=/dev/null
else
    log_file=/var/log/webfile/run.log
fi

$WEBFILE "$@" > $log_file 2>&1
