Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1dc127757c | ||
|
|
3c259f0bf1 | ||
|
|
b7130cccc5 |
9
Makefile
9
Makefile
@@ -9,13 +9,13 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
ARCH = x86_64
|
ARCH = x86_64
|
||||||
DEPENDS = dash,glibc
|
DEPENDS = dash,glibc,sysvinit
|
||||||
BUILDDEPS =
|
BUILDDEPS =
|
||||||
URL = http://ftp.isc.org/isc/cron/
|
URL = http://ftp.isc.org/isc/cron/
|
||||||
REPO = main
|
REPO = main
|
||||||
BRIEF = daemon to execute scheduled commands
|
BRIEF = daemon to execute scheduled commands
|
||||||
DESC = An implimentation of cron based on the SysV cron (aka Vixie cron)
|
DESC = An implimentation of cron based on the SysV cron (aka Vixie cron)
|
||||||
SNAPVER = 0
|
SNAPVER = 3
|
||||||
|
|
||||||
ARCHIVE := $(PWD)/$(shell ls SRC/*.shar|tail -1)
|
ARCHIVE := $(PWD)/$(shell ls SRC/*.shar|tail -1)
|
||||||
SRCDIR := cron-$(shell echo $(ARCHIVE)|egrep -o '[0-9]\.[0-9]')
|
SRCDIR := cron-$(shell echo $(ARCHIVE)|egrep -o '[0-9]\.[0-9]')
|
||||||
@@ -63,8 +63,8 @@ $(ROOT): $(SRCDIR)/cron
|
|||||||
install -v -m 644 crontab.1 $(ROOT)/usr/share/man/man1/crontab.1 && \
|
install -v -m 644 crontab.1 $(ROOT)/usr/share/man/man1/crontab.1 && \
|
||||||
install -v -m 644 crontab.5 $(ROOT)/usr/share/man/man5/crontab.5 && \
|
install -v -m 644 crontab.5 $(ROOT)/usr/share/man/man5/crontab.5 && \
|
||||||
install -v -m 644 cron.8 $(ROOT)/usr/share/man/man8/cron.8 && \
|
install -v -m 644 cron.8 $(ROOT)/usr/share/man/man8/cron.8 && \
|
||||||
install -v -m 755 $(SNAPDIR)/cron.init $(ROOT)/etc/init.d/cron
|
install -v -m 755 $(SNAPDIR)/cron.init $(ROOT)/etc/init.d/cron && \
|
||||||
install -v -m 600 $(SNAPDIR)/crontab $(ROOT)/usr/share/cron/crontab
|
install -v -m 755 $(SNAPDIR)/runall $(ROOT)/bin
|
||||||
|
|
||||||
test: $(ROOT)
|
test: $(ROOT)
|
||||||
@cd $(SRCDIR); \
|
@cd $(SRCDIR); \
|
||||||
@@ -75,5 +75,6 @@ clean:
|
|||||||
$(SNAPINFO) \
|
$(SNAPINFO) \
|
||||||
$(MANIFEST) \
|
$(MANIFEST) \
|
||||||
$(FILES) \
|
$(FILES) \
|
||||||
|
$(CONFIG) \
|
||||||
$(SRCDIR)
|
$(SRCDIR)
|
||||||
|
|
||||||
|
|||||||
@@ -36,13 +36,7 @@ case "$1" in
|
|||||||
$0 start
|
$0 start
|
||||||
;;
|
;;
|
||||||
status)
|
status)
|
||||||
pid=$(pidofproc -p "$PIDFILE" "$DAEMON")
|
status_of_proc -p "$PIDFILE" "$DAEMON" || exit 1
|
||||||
|
|
||||||
if [ "$?" -ne 0 ]; then
|
|
||||||
echo "cron not running"
|
|
||||||
else
|
|
||||||
echo "cron running with PID: $pid"
|
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: $0 [start|stop|restart|status]"
|
echo "Usage: $0 [start|stop|restart|status]"
|
||||||
|
|||||||
39
SNAP/runall
Executable file
39
SNAP/runall
Executable file
@@ -0,0 +1,39 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
usage () {
|
||||||
|
echo "Usage: ${0#*/} [DIRECTORY]..."
|
||||||
|
echo "Run all executable scripts in one or more directories"
|
||||||
|
|
||||||
|
exit $1
|
||||||
|
}
|
||||||
|
|
||||||
|
ERRORS=
|
||||||
|
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
usage 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
for dir in "$@"; do
|
||||||
|
dir=${dir%/}
|
||||||
|
if [ ! -d "$dir" ]; then
|
||||||
|
echo "$dir: invalid directory"
|
||||||
|
|
||||||
|
usage 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
for file in "$dir"/*; do
|
||||||
|
if [ -x "$file" ]; then
|
||||||
|
"$file"
|
||||||
|
|
||||||
|
if [ "$?" -gt 0 ]; then
|
||||||
|
ERRORS="$ERRORS $file"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -n "$ERRORS" ]; then
|
||||||
|
echo "There were errors in the following scripts:$ERRORS"
|
||||||
|
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
@@ -7,12 +7,11 @@ case $1 in
|
|||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
postinst)
|
postinst)
|
||||||
[ -f "/run/cron.pid" ] && /etc/init.d/cron restart
|
/etc/init.d/cron status 2>&1 > /dev/null && /etc/init.d/cron restart
|
||||||
[ -f "/etc/crontab" ] || cp /usr/share/cron/crontab /etc/crontab
|
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
prerm)
|
prerm)
|
||||||
[ -f "/run/cron.pid" ] && /etc/init.d/cron stop
|
/etc/init.d/cron status 2>&1 > /dev/null && /etc/init.d/cron stop
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
postrm)
|
postrm)
|
||||||
|
|||||||
Reference in New Issue
Block a user