[packages] ucarp: fix hardcoded paths to binaries (#7345)

git-svn-id: svn://svn.openwrt.org/openwrt/packages@21496 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
jow 2010-05-17 20:05:32 +00:00
parent 40b6e7408b
commit 2f4d192f2f
2 changed files with 8 additions and 5 deletions

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=ucarp PKG_NAME:=ucarp
PKG_VERSION:=1.5.2 PKG_VERSION:=1.5.2
PKG_RELEASE:=2 PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://download.pureftpd.org/pub/ucarp PKG_SOURCE_URL:=http://download.pureftpd.org/pub/ucarp

View File

@ -2,6 +2,9 @@
START=50 START=50
CONF=/etc/ucarp.conf CONF=/etc/ucarp.conf
IP=$(which ip)
UCARP=$(which ucarp)
ARPING=$(which arping)
start() { start() {
. ${CONF} . ${CONF}
@ -11,13 +14,13 @@ start() {
cat > /var/run/ucarp-vip-up <<EOF cat > /var/run/ucarp-vip-up <<EOF
#!/bin/sh #!/bin/sh
/bin/ip addr add ${VIP}/${VMASK} dev ${IF} $IP addr add ${VIP}/${VMASK} dev ${IF}
EOF EOF
for ip in ${PINGIP} for ip in ${PINGIP}
do do
cat >> /var/run/ucarp-vip-up <<EOF cat >> /var/run/ucarp-vip-up <<EOF
/usr/bin/arping -c 2 -I ${IF} -s ${VIP} ${ip} $ARPING -c 2 -I ${IF} -s ${VIP} ${ip}
EOF EOF
done done
chmod a+x /var/run/ucarp-vip-up chmod a+x /var/run/ucarp-vip-up
@ -25,12 +28,12 @@ EOF
cat > /var/run/ucarp-vip-down <<EOF cat > /var/run/ucarp-vip-down <<EOF
#!/bin/sh #!/bin/sh
/bin/ip addr del ${VIP}/${VMASK} dev ${IF} $IP addr del ${VIP}/${VMASK} dev ${IF}
EOF EOF
chmod a+x /var/run/ucarp-vip-down chmod a+x /var/run/ucarp-vip-down
/usr/sbin/ucarp --interface=${IF} --srcip=${MYIP} --vhid=1 --pass=${PASSWORD} \ $UCARP --interface=${IF} --srcip=${MYIP} --vhid=1 --pass=${PASSWORD} \
--addr=${VIP} --nomcast $daemon \ --addr=${VIP} --nomcast $daemon \
--upscript=/var/run/ucarp-vip-up --downscript=/var/run/ucarp-vip-down --upscript=/var/run/ucarp-vip-up --downscript=/var/run/ucarp-vip-down
} }