File: setoops

package info (click to toggle)
whereami 0.3.36
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 424 kB
  • sloc: sh: 1,094; perl: 524; makefile: 24
file content (30 lines) | stat: -rwxr-xr-x 714 bytes parent folder | download | duplicates (8)
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
#!/bin/bash 

# This script was written Fedor Karpelevitch to reconfigure
# the lightweight "oops" proxy server to use a different
# upstream proxy, or to use no proxy at all.

UPSTREAM="$@"
CONFFILE=/etc/oops/oops.cfg


if [ "$UPSTREAM" != "stop" ]; then 
    echo "Setting upstream proxy host ($UPSTREAM)" 

    if [ "$UPSTREAM" != "none" ]; then 
        echo parent	$UPSTREAM > $CONFFILE.N
    fi
    grep -v "^parent " $CONFFILE >> $CONFFILE.N

    mv $CONFFILE.N $CONFFILE

    # echo Reconfiguring oops...
    # /usr/sbin/oopsctl reconfigure
    # echo Oops reconfigured.
    echo Restarting oops
    /etc/init.d/oops restart
    echo Restarted oops
else
    echo Stopping oops
    /etc/init.d/oops stop
fi