drun.sh 400 Bytes
Newer Older
olaf michaelis's avatar
olaf michaelis committed
1
2
3
#!/bin/bash

function sanitize(){
4
    r="$(echo "/${1}/" \
olaf michaelis's avatar
olaf michaelis committed
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
        | tr -s "/" \
        | sed 's/.$//'
    )"
    if [[ -z "${r}" ]]; then
        echo "/"
    else
        echo "${r}"
    fi
}

export BASE_STATIC=$(sanitize "${BASE_URL}/static")
export BASE_URL=$(sanitize "${BASE_URL}")

# apache gets grumpy about pre-existing pid files
rm -f /usr/local/apache2/logs/httpd.pid
httpd -DFOREGROUND