4
Fork 0

Fising issue with crontab

This commit is contained in:
Artem Prilutskiy 2016-08-09 14:12:09 +03:00
parent e40a73b8ce
commit cb782cbe63
3 changed files with 12 additions and 3 deletions

View file

@ -78,4 +78,7 @@ else
dpkg-buildpackage -b -tc
endif
macos-archive: build
zip ../CronosAgent-macOS.zip cronosagent cronosagent.sh cronosagent.conf cronosagent.plist
.PHONY: all build clean install

View file

@ -32,14 +32,12 @@ define Package/cronosagent/install
$(INSTALL_DIR) $(1)/opt/CronosAgent
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/crontabs
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi/cronosagent
$(INSTALL_BIN) $(PKG_BUILD_DIR)/cronosagent $(1)/opt/CronosAgent/
$(INSTALL_BIN) $(X_SOURCE_DIR)/cronosagent.sh $(1)/opt/CronosAgent/
$(INSTALL_BIN) $(X_SOURCE_DIR)/OpenWRT/init.d/cronosagent $(1)/etc/init.d/
$(INSTALL_DATA) $(X_SOURCE_DIR)/OpenWRT/config/cronosagent $(1)/etc/config/
$(INSTALL_DATA) $(X_SOURCE_DIR)/OpenWRT/crontabs/cronosagent $(1)/etc/crontabs/
$(INSTALL_DATA) $(X_SOURCE_DIR)/OpenWRT/controller/cronosagent.lua $(1)/usr/lib/lua/luci/controller/
$(INSTALL_DATA) $(X_SOURCE_DIR)/OpenWRT/model/cbi/cronosagent/configure.lua $(1)/usr/lib/lua/luci/model/cbi/cronosagent/
endef
@ -52,6 +50,15 @@ define Package/cronosagent/postinst
#!/bin/sh
/etc/init.d/cronosagent enable
/etc/init.d/cronosagent start
grep cronosagent /etc/crontabs/root > /dev/null
if [ "$?" -eq "1" ]
then
cat << EOF >> /etc/crontabs/root
*/10 * * * * test -n "$(ls /etc/rc.d/S??cronosagent)" -a -z "$(pidof cronosagent)" && /etc/init.d/cronosagent start
EOF
fi
/etc/init.d/cron enable
/etc/init.d/cron start
exit 0

View file

@ -1 +0,0 @@
*/10 * * * * test -n "$(ls /etc/rc.d/S??cronosagent)" -a -z "$(pidof cronosagent)" && /etc/init.d/cronosagent start