#!/bin/bash

rss=$(ps aux | grep frpc.toml | grep -v grep | awk '{print $6}')
if [[ $rss == '' ]]; then
    python3 /opt/scripts/alert/bark/msgsend.py --title "FRPC Warning" --body "Seems like FRPC 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 frpc.service
fi



