-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathforever.sh
31 lines (29 loc) · 836 Bytes
/
forever.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env sh
# sleep time
PRIMER_STEP_FOREVER_SLEEP=${PRIMER_STEP_FOREVER_SLEEP:-5}
primer_step_forever() {
case "$1" in
"option")
shift;
[ "$#" = "0" ] && echo "--sleep"
while [ $# -gt 0 ]; do
case "$1" in
--sleep)
PRIMER_STEP_FOREVER_SLEEP=$2; shift 2;;
-*)
yush_warn "Unknown option: $1 !"; shift 2;;
*)
break;;
esac
done
;;
"install")
yush_notice "Will sleep forever with at ${PRIMER_STEP_FOREVER_SLEEP}s intervals"
while true; do
sleep "$PRIMER_STEP_FOREVER_SLEEP"
done
;;
"clean")
;;
esac
}