view host/stop.sh @ 2057:634a44d10c96 acme-tiny

https.luan cleanup and add test
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 12 Nov 2025 23:18:04 -0700
parents 1f4c590bf0ae
children
line wrap: on
line source

#!/bin/bash

. check_app.sh;

#seconds to wait
toWait=30;
i=0;

getPids;

if [ "$PIDS" != "" ]; then
  while [ $i -lt $toWait ]; do
    kill -TERM $PIDS;
    sleep 1;
    getPids;
    if [ "$PIDS" == "" ]; then
      break
    fi;
    let i=$i+1;
  done;

  if [ "$PIDS" != "" ]; then
    echo "Can't stop app in ${i} seconds";
    exit 0;
  else
    rm started.lock;
    echo "App stopped";
  fi;
else
    echo "no running app found";
fi;

sudo $(which nginx) -s stop -c $(pwd)/local/nginx.conf;
exit 0;