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 can prevent multiple crond running
we clean our own shit
  • Loading branch information
backslashxx committed Dec 16, 2024
1 parent c66d241 commit 8ffaa14
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
for i in $(pidof busybox); do grep -q "bindhosts" /proc/$i/cmdline > /dev/null 2>&1 && kill -9 $i ; done
rm -rf $PERSISTENT_DIR/crontabs
echo "[x] crontab entry removed!"
else
Expand Down

0 comments on commit 8ffaa14

Please sign in to comment.