#!/bin/sh

REMOTE=share

status="$(systemctl --user is-active share-sync)"

case "$status" in
  "active")
    ping -c1 -w5 $REMOTE 1>/dev/null 2>/dev/null

    if [ $? -eq 0 ]; then
      echo "+@fg=4;✔+@fg=0;"
    else
      echo "+@fg=3;!+@fg=0;"
    fi ;;

  *)
    echo "+@fg=3;✘+@fg=0;" ;;
esac
