safe-search: prevent duplicate cron job installation
This patch prevents multiple cron jobs from being created to run the safe-search-maintenance script. To reproduce this bug, perform the following: - Install safe-search - Perform an OpenWRT firmware upgrade (choose to preserve user settings) - Install safe-search again Signed-off-by: Gregory L. Dietsche <gregory.dietsche@cuw.edu>
This commit is contained in:
parent
0d505441be
commit
49535edffd
|
@ -6,8 +6,8 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=safe-search
|
PKG_NAME:=safe-search
|
||||||
PKG_VERSION:=2.0.0
|
PKG_VERSION:=2.0.1
|
||||||
PKG_RELEASE:=3
|
PKG_RELEASE:=$(AUTORELEASE)
|
||||||
PKG_LICENSE:=MIT
|
PKG_LICENSE:=MIT
|
||||||
PKG_MAINTAINER:=Gregory L. Dietsche <Gregory.Dietsche@cuw.edu>
|
PKG_MAINTAINER:=Gregory L. Dietsche <Gregory.Dietsche@cuw.edu>
|
||||||
|
|
||||||
|
@ -54,6 +54,7 @@ endef
|
||||||
define Package/safe-search/postinst
|
define Package/safe-search/postinst
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||||
|
crontab -l | grep -v "safe-search-maintenance" | sort | uniq | crontab -
|
||||||
echo "1 1 * * 1 /bin/nice /usr/sbin/safe-search-maintenance>/dev/null 2>&1">>/etc/crontabs/root
|
echo "1 1 * * 1 /bin/nice /usr/sbin/safe-search-maintenance>/dev/null 2>&1">>/etc/crontabs/root
|
||||||
/etc/init.d/cron restart
|
/etc/init.d/cron restart
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue