mirror of
https://github.com/kasmtech/workspaces-core-images.git
synced 2024-11-24 16:33:19 +01:00
KASM-5589 time limit wmctrl cmd, quite curl output
This commit is contained in:
parent
28ca768381
commit
2850616203
@ -8,7 +8,7 @@ log () {
|
||||
INGEST_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
||||
echo "${INGEST_DATE} ${LOG_LEVEL} (${APP_NAME}): $1"
|
||||
if [ ! -z "${KASM_API_JWT}" ] && [ ! -z "${KASM_API_HOST}" ] && [ ! -z "${KASM_API_PORT}" ]; then
|
||||
http_proxy="" https_proxy="" curl https://${KASM_API_HOST}:${KASM_API_PORT}/api/kasm_session_log?token=${KASM_API_JWT} --max-time 1 -X POST -H 'Content-Type: application/json' -d '[{ "host": "'"${KASM_ID}"'", "application": "Session", "ingest_date": "'"${INGEST_DATE}"'", "message": "'"$1"'", "levelname": "'"${LOG_LEVEL}"'", "process": "'"${APP_NAME}"'", "kasm_user_name": "'"${KASM_USER_NAME}"'", "kasm_id": "'"${KASM_ID}"'" }]' -k
|
||||
http_proxy="" https_proxy="" curl https://${KASM_API_HOST}:${KASM_API_PORT}/api/kasm_session_log?token=${KASM_API_JWT} --max-time 1 -X POST -H 'Content-Type: application/json' -d '[{ "host": "'"${KASM_ID}"'", "application": "Session", "ingest_date": "'"${INGEST_DATE}"'", "message": "'"$1"'", "levelname": "'"${LOG_LEVEL}"'", "process": "'"${APP_NAME}"'", "kasm_user_name": "'"${KASM_USER_NAME}"'", "kasm_id": "'"${KASM_ID}"'" }]' -k -s
|
||||
fi
|
||||
fi
|
||||
}
|
||||
@ -33,7 +33,7 @@ fi
|
||||
for x in {1..10}
|
||||
do
|
||||
|
||||
if [[ $(wmctrl -l | awk '{$3=""; $2=""; $1=""; print $0}' | grep -i chrome) ]]
|
||||
if [[ $(timeout 1 wmctrl -l | awk '{$3=""; $2=""; $1=""; print $0}' | grep -i chrome) ]]
|
||||
then
|
||||
PAUSE_ON_EXIT="true"
|
||||
echo "Closing Chrome Windows Attempt ($x)..."
|
||||
@ -46,7 +46,7 @@ done
|
||||
for x in {1..10}
|
||||
do
|
||||
|
||||
if [[ $(wmctrl -l | awk '{$3=""; $2=""; $1=""; print $0}' | grep -i firefox) ]]
|
||||
if [[ $(timeout 1 wmctrl -l | awk '{$3=""; $2=""; $1=""; print $0}' | grep -i firefox) ]]
|
||||
then
|
||||
PAUSE_ON_EXIT="true"
|
||||
echo "Closing Firefox Windows Attempt ($x)..."
|
||||
|
@ -10,7 +10,7 @@ log () {
|
||||
INGEST_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
||||
echo "${INGEST_DATE} ${LOG_LEVEL} (${APP_NAME}): $1"
|
||||
if [ ! -z "${KASM_API_JWT}" ] && [ ! -z "${KASM_API_HOST}" ] && [ ! -z "${KASM_API_PORT}" ]; then
|
||||
http_proxy="" https_proxy="" curl https://${KASM_API_HOST}:${KASM_API_PORT}/api/kasm_session_log?token=${KASM_API_JWT} --max-time 1 -X POST -H 'Content-Type: application/json' -d '[{ "host": "'"${KASM_ID}"'", "application": "Session", "ingest_date": "'"${INGEST_DATE}"'", "message": "'"$1"'", "levelname": "'"${LOG_LEVEL}"'", "process": "'"${APP_NAME}"'", "kasm_user_name": "'"${KASM_USER_NAME}"'", "kasm_id": "'"${KASM_ID}"'" }]' -k
|
||||
http_proxy="" https_proxy="" curl https://${KASM_API_HOST}:${KASM_API_PORT}/api/kasm_session_log?token=${KASM_API_JWT} --max-time 1 -X POST -H 'Content-Type: application/json' -d '[{ "host": "'"${KASM_ID}"'", "application": "Session", "ingest_date": "'"${INGEST_DATE}"'", "message": "'"$1"'", "levelname": "'"${LOG_LEVEL}"'", "process": "'"${APP_NAME}"'", "kasm_user_name": "'"${KASM_USER_NAME}"'", "kasm_id": "'"${KASM_ID}"'" }]' -k -s
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user