#!/bin/bash

rss=$(ps aux | grep frps.toml | grep -v grep | awk '{print $6}')
if [[ $rss == '' ]]; then
    ssh -o ConnectTimeout=60 beelink 'python3 /opt/scripts/alert/bark/msgsend.py --title "FRPS Warning" --body "Seems like FRPS Service has been down, need to check ASAP." --group "frp" --icon 8'
    exit 9
fi

rss=$((rss/1024))

if [[ $rss -gt 500 ]]; then
    systemctl restart frps.service
fi



