File: stop-local-server

package info (click to toggle)
phpmyadmin 4%3A5.2.2-really%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 140,312 kB
  • sloc: javascript: 228,447; php: 166,904; xml: 17,847; sql: 504; sh: 275; makefile: 209; python: 205
file content (44 lines) | stat: -rwxr-xr-x 1,109 bytes parent folder | download | duplicates (3)
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
40
41
42
43
44
#!/bin/sh

# Do not run as CGI
if [ -n "$GATEWAY_INTERFACE" ] ; then
    echo 'Can not invoke as CGI!'
    exit 1
fi

set -e
set -x

if [ "$CI_MODE" != "selenium" ] ; then
    echo "Not in CI_MODE=selenium"
    exit 0
fi

SELENIUM_TEMPDIR="$(cat /tmp/last_temp_dir_phpMyAdminTests)"

if [ ! -z "$TESTSUITE_BROWSERSTACK_KEY" ] ; then
    # Stop BrowserStack Local forwarder
    ~/browserstack/BrowserStackLocal --daemon stop
fi

if [ -f ~/selenium-standalone.pid~ ] ; then
    # Stop selenium-standalone server
    kill $(cat ~/selenium-standalone.pid~)
    rm ~/selenium-standalone.pid~
fi

if [ ! -z "${SELENIUM_TEMPDIR}" ] && [ -f "${SELENIUM_TEMPDIR}/nginx.pid" ]; then
    # Stop nginx server
    kill $(cat "${SELENIUM_TEMPDIR}/nginx.pid")
fi

if [ ! -z "${SELENIUM_TEMPDIR}" ] && [ -f "${SELENIUM_TEMPDIR}/php-fpm.pid" ]; then
    # Stop php-fpm server
    kill $(cat "${SELENIUM_TEMPDIR}/php-fpm.pid")
fi

if [ ! -z "${SELENIUM_TEMPDIR}" ] && [ -d "${SELENIUM_TEMPDIR}" ]; then
    # Delete the temporary folder
    rm -rf "${SELENIUM_TEMPDIR}"
    echo "Deleted temporary dir: ${SELENIUM_TEMPDIR}"
fi