Skip to content

Commit

Permalink
scripts/bindhosts: add crond killer on disable_cron
Browse files Browse the repository at this point in the history
this way we wont have multiple crond running
we clean our own shit
  • Loading branch information
backslashxx committed Dec 16, 2024
1 parent c66d241 commit d1a11e3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions module/bindhosts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ enable_cron() {
disable_cron() {
if grep -q "bindhosts.sh" $PERSISTENT_DIR/crontabs/root > /dev/null 2>&1; then
echo "[>] $(head -n1 $PERSISTENT_DIR/crontabs/root) "
# todo: find a way to kill busybox crond
# with just toybox ps
# kill busybox crond that we enabled
# super leet gamma knife
( kill -9 $(for i in $(pidof busybox); do grep "bindhosts" /proc/$i/cmdline | cut -d "/" -f 3 ; done) ) > /dev/null 2>&1
rm -rf $PERSISTENT_DIR/crontabs
echo "[x] crontab entry removed!"
else
Expand Down

0 comments on commit d1a11e3

Please sign in to comment.