]>
Commit | Line | Data |
---|---|---|
fe42a3bb JR |
1 | diff -ur arcavir2010/usr/bin/arcaupdate arcavir2010-update/usr/bin/arcaupdate |
2 | --- arcavir2010/usr/bin/arcaupdate 2010-08-09 14:20:39.000000000 +0200 | |
3 | +++ arcavir2010-update/usr/bin/arcaupdate 2010-08-17 14:14:50.801594212 +0200 | |
4 | @@ -1,4 +1,4 @@ | |
5 | -#!/bin/bash | |
6 | +#!/bin/sh | |
7 | # | |
8 | # ArcaVir 2010 Server update script. | |
9 | # Copyright (C) 2009 ArcaBit sp. z o.o. | |
ade925dd | 10 | @@ -10,18 +10,18 @@ |
fe42a3bb JR |
11 | |
12 | . /usr/share/arcavir/functions || { echo 'Cannot load /usr/share/arcavir/functions!'; exit 1; } | |
13 | ||
14 | -# if ( set -o noclobber; echo "$$" > ${lockfile} ) 2>/dev/null; then | |
15 | -# trap "${rm} -f ${lockfile}" int term exit | |
16 | +if ( set -o noclobber; echo "$$" > ${lockfile} ) 2>/dev/null; then | |
17 | + trap "${rm} -f ${lockfile}" int term exit | |
18 | ${get} "${repo}" || exit 1 | |
19 | - [ -x /etc/init.d/arcad ] && /etc/init.d/arcad stop | |
20 | - ${propagate} "${repo}" "${dst}" || exit 1 | |
21 | + cp -rp "${repo}"/bases/* "${dst}"/var/lib/arcavir/bases/ | |
22 | [ -x ${bt} ] && \ | |
23 | - ${bt} "${dst}"var/lib/arcavir/bases/ "${dst}"var/lib/arcavir/bases/abasetr_bt.dat && \ | |
24 | - ${chown} arcabit:arcabit "${dst}"var/lib/arcavir/bases/abasetr_bt.dat | |
25 | - [ -x /etc/init.d/arcad ] && /etc/init.d/arcad start | |
26 | -# ${rm} -f ${lockfile} | |
27 | -#else | |
28 | -# die 'Cannot open lockfile' | |
29 | -#fi | |
30 | + ${bt} "${dst}"var/lib/arcavir/bases/ "${dst}"var/lib/arcavir/bases/abasetr_bt.dat | |
31 | + chown -R arcabit:arcabit "${dst}"/var/lib/arcavir/bases/ | |
ade925dd JR |
32 | + read arcadpid 2>/dev/null </var/run/arcad.pid |
33 | + [ -n "$arcadpid" ] && kill -HUP $arcadpid | |
fe42a3bb JR |
34 | + ${rm} -f ${lockfile} |
35 | +else | |
36 | + die 'Cannot open lockfile' | |
37 | +fi | |
38 | ||
39 | exit 0 | |
40 | diff -ur arcavir2010/usr/bin/arcaupdate-get arcavir2010-update/usr/bin/arcaupdate-get | |
41 | --- arcavir2010/usr/bin/arcaupdate-get 2010-08-09 14:20:39.000000000 +0200 | |
42 | +++ arcavir2010-update/usr/bin/arcaupdate-get 2010-08-17 14:13:35.729594210 +0200 | |
43 | @@ -18,26 +18,6 @@ | |
44 | ||
45 | cache="$@" | |
46 | ||
47 | -rawos=$(${uname} -o) | |
48 | -rawmach=$(${uname} -m) | |
49 | - | |
50 | -os= | |
51 | -mach= | |
52 | - | |
53 | -[ "${rawos}" = 'GNU/Linux' ] && os='linux' | |
54 | -# xxx more to follow | |
55 | - | |
56 | -[ "${rawmach}" = 'i386' ] && mach='i386' | |
57 | -[ "${rawmach}" = 'i486' ] && mach='i386' | |
58 | -[ "${rawmach}" = 'i586' ] && mach='i386' | |
59 | -[ "${rawmach}" = 'i686' ] && mach='i386' | |
60 | -[ "${rawmach}" = 'x86_64' ] && mach='amd64' | |
61 | - | |
62 | -[ "${os}" = '' ] && die "Unknown system ${rawos}" | |
63 | -[ "${mach}" = '' ] && die "Unknown machine ${rawmach}" | |
64 | - | |
65 | -suffix=core/${os}-${mach} | |
66 | - | |
67 | verifybasessig() | |
68 | { | |
69 | isprog "${gpg}" | |
70 | @@ -60,29 +40,6 @@ | |
71 | } | |
72 | ||
73 | ${mkdir} -p ${cache}/bases || die 'mkdir failed' | |
74 | -${rsync} --no-motd -a rsync://${rsyncpath}/${suffix}/ "${cache}" 2> /dev/null | |
75 | -if [ $? -gt 0 ]; then | |
76 | - echo 'arcaupdate-get: warning: rsync failed for core, falling back to http' | |
77 | - ${rm} -rf "${cache}/*" || die 'rm failed' | |
78 | - cd "${cache}" || die 'cd failed' | |
79 | - ${wget} --quiet -N -P "${cache}" -np -nd -r -R 'index.html*' http://${httppath}/${suffix}/ || die 'wget failed' | |
80 | - ${rm} -f "${cache}/robots.txt" | |
81 | -fi | |
82 | - | |
83 | -isprog "${gpg}" | |
84 | -if [ $? -eq 0 ]; then | |
85 | - ${gpg} --no-default-keyring --keyring /var/lib/arcavir/pubring.gpg -q --batch -d < "${cache}/files.gpg" > "${cache}/files.txt" 2>/dev/null | |
86 | - if [ $? -gt 0 ]; then | |
87 | - ${rm} -rf "${cache}/*" | |
88 | - die 'GnuPG verify failed! Someone may be tampering with your repository.' | |
89 | - fi | |
90 | -else | |
91 | - log_warn 'arcaupdate-get: warning: GnuPG not found. We STRONGLY suggest that you ' | |
92 | - log_warn 'arcaupdate-get: warning: install it. Please see the apropriate section ' | |
93 | - log_warn 'arcaupdate-get: warning: in README for details.' | |
94 | -fi | |
95 | - | |
96 | -# to samo dla baz | |
97 | ||
98 | tmpfile=/tmp/arcaupdate.tmp | |
99 | ||
642f5a54 JR |
100 | --- arcavir2010-update/usr/share/arcavir/functions~ 2010-08-09 14:20:39.000000000 +0200 |
101 | +++ arcavir2010-update/usr/share/arcavir/functions 2010-08-18 11:06:41.569925597 +0200 | |
102 | @@ -24,7 +24,7 @@ | |
103 | # Various other variables | |
104 | repo=/var/cache/arcavir/update | |
105 | dst=/ | |
106 | -lockfile=/var/run/arcaupdate.lock | |
107 | +lockfile=/var/cache/arcavir/update/arcaupdate.lock | |
108 | ||
109 | rsyncpath=80.72.37.138/ArcaLinux2010 | |
110 | httppath=80.72.37.138/update/ArcaLinux2010 |