first commit
This commit is contained in:
54
archiso/airootfs/home/smart/SmartOrganizer/inc.conf
Executable file
54
archiso/airootfs/home/smart/SmartOrganizer/inc.conf
Executable file
@@ -0,0 +1,54 @@
|
||||
LOG_FILE="${ROOT_PATH}/SmartOrganizer.log"
|
||||
SOS_TIMER_STEP=30
|
||||
|
||||
debugger()
|
||||
{
|
||||
if ${DEBUG}; then
|
||||
echo "[$(date +%T)][DEBUG] $@"
|
||||
fi
|
||||
}
|
||||
|
||||
logger()
|
||||
{
|
||||
echo "[$(date +%T)] $@"
|
||||
}
|
||||
|
||||
tasks_path()
|
||||
{
|
||||
if [[ ! -d ${ROOT_PATH}/tasks ]]; then
|
||||
mkdir -p ${ROOT_PATH}/tasks
|
||||
chmod 0777 ${ROOT_PATH}/tasks
|
||||
fi
|
||||
|
||||
echo ${ROOT_PATH}/tasks
|
||||
}
|
||||
|
||||
downloads_path()
|
||||
{
|
||||
if [[ ! -d ${ROOT_PATH}/downloads ]]; then
|
||||
mkdir -p ${ROOT_PATH}/downloads
|
||||
fi
|
||||
|
||||
echo ${ROOT_PATH}/downloads
|
||||
}
|
||||
|
||||
syncSoftwareStatus()
|
||||
{
|
||||
hostname=$(hostname)
|
||||
name=${1}
|
||||
version=${2}
|
||||
logger "Sync software status: ${hostname}:${name}:${version}"
|
||||
curl -sS -D /dev/null -o /dev/null -H "hostname:${hostname}" "https://c.baobaot.com/api/software/sync_status?name=${name}&version=${version}"
|
||||
}
|
||||
|
||||
getSoftwareStatus()
|
||||
{
|
||||
hostname=${1}
|
||||
if [[ ! -n ${hostname} ]]; then
|
||||
hostname=$(hostname)
|
||||
fi
|
||||
curl -sS -D /dev/null -H "hostname:${hostname}" "https://c.baobaot.com/api/tms/soft_check?hostname=${hostname}"
|
||||
}
|
||||
|
||||
TASKS_PATH=$(tasks_path)
|
||||
DOWNLOADS_PATH=$(downloads_path)
|
||||
Reference in New Issue
Block a user