File: myapp

package info (click to toggle)
kore 4.1.0-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,808 kB
  • sloc: ansic: 27,141; makefile: 323; sh: 250; python: 138; cpp: 34
file content (39 lines) | stat: -rwxr-xr-x 638 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash

set -euo pipefail
IFS=$'\n\t'

if [ ! -e /dev/urandom ]; then
    echo "There is no /dev/urandom."
    exit 1
fi

kodev create myapp
cd myapp || exit 1

kodev info

timeout --preserve-status -k 60s -s SIGQUIT 60s kodev run &
PID="$!"

if [ "$(grep ^Seccomp: "/proc/$PID/status" | awk '{print $2}')" != 2 ]; then
    grep ^Seccomp: "/proc/$PID/status"
    sleep 5
    exit 1
fi

loop=0
while ! wget -S -q -T 1 --tries=3 --no-check-certificate https://127.0.0.1:8888 -O -; do
    sleep 1
    loop=$((loop+1))
    if [ "$loop" -gt 10 ]; then
        exit 1
    fi
done

cd ..

rm -fr myapp

kill -SIGQUIT $PID
wait $PID || true