summaryrefslogtreecommitdiffstats
path: root/usr/local/sbin/update_file.sh
blob: 61753f0f34b19e680fa8ee0b3697f753d85b2d5b (plain)
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
#!/bin/sh

if [ ! -x `which fetch` ];then
    echo "no fetch found, I think databeestje lost that part"
    exit 0
fi

baseurl='http://pfsense.com/cgi-bin/cvsweb.cgi/pfSense'
urlrev='?rev='
urlcon=';content-type=text%2Fplain'
rev='1'

if [ -z $1 ];then
    echo "No file to update given"
    echo "Usage: $0 /path/to/file [revision]"
    exit 0
fi

if [ ! -f $1 ];then
    echo "File $1 doesn't exist"
    exit 0
fi

if [ ! -z $2 ];then
    rev=$2
    echo "trying to fetch $rev"
else
    echo "trying to fetch latest"
fi

`which fetch` -o "$1" "$baseurl$1$urlrev$rev$urlcon"
OpenPOWER on IntegriCloud