Skip to content

u/Sharp_Eyed_Bot

In this archive from Nov 2015 to Aug 2021

6
posts
32
comments
5
media
8.1k
score
#!/bin/bash
get_status()
{
    STATE=`systemctl show -p SubState --value $1`

    if [ "$STATE" = "running" ];
    then
    echo "[\e[92m✔\e[0m]"
    else
    echo "[\e[5m\e[91m✘\e[0m]"
    fi
}

get_ssl()
{
    ssl_domains=""
    currentTime=$(date +%s)

    line=""
    for domain in $ssl_domains; do
        certTime=$(openssl s_client -connect ${domain}:443 < /dev/null 2>/dev/nu                                                                                                                                                             ll | openssl x509 -noout -enddate 2>/dev/null | cut -d= -f2)
        certLineTime=$(date -d "${certTime}" +"%b %d %Y")
        certTimestamp=$(date -d "${certTime}" +%s)
        if [ "${certTimestamp}" -ge "${currentTime}" ]; then
            sign="\e[32m●"
        else
            sign="\e[31m▲"
        fi
        line+="\e[0m ${certLineTime}"
    done
    echo -e $line
}

get_diskusage()
{
    UsedMedia=$(df -h <PATH> | sed -n 2p |  awk '{print $3}')
    FreeMedia=$(df -h <PATH>  | sed -n 2p |  awk '{print $4}')
    echo $UsedMedia Used \($FreeMedia Free\)
}

echo -e "\e[96m                   -@                \e[0mWaimak \e[92m5.0\e[0m -                                                                                                                                                              Status"
echo -e "\e[96m                  .##@               \e[0m"
echo -e "\e[96m                 .####@              \e[0mPlex Media Server: " $(get_status plexmediaserver)
echo -e "\e[96m                 @#####@             \e[0mDeluge Web Daemon: " $(get_status "deluge-web")
echo -e "\e[96m               . *######@            \e[0mDeluge Daemon:     " $(get_status "deluged")
echo -e "\e[96m              .##@o@#####@           \e[0mPi-Hole FTL:       " $(get_status "pihole-FTL")
echo -e "\e[96m             /############@          \e[0mTautulli:          " $(get_status "tautulli")
echo -e "\e[96m            /##############@         \e[0mLighttpd:          " $(get_status "lighttpd")
echo -e "\e[96m           @######@**%######@        \e[0mJackett:           " $(get_status "jackett")
echo -e "\e[96m          @######\`     %#####o       \e[0mRadarr:            " $(get_status "radarr")
echo -e "\e[96m         @######@       ######%     \e[0m SSL Status:       " $(get_ssl)
echo -e "\e[96m       -@#######h       ######@.     \e[0m"
echo -e "\e[96m      /#####h**\`\`      \`**%@####     \e[0mUptime:            "$(uptime -p | cut -c 3-)
echo -e "\e[96m     @H@*\`                    \`*%@\e[0m   Disk:              "$(get_diskusage)

Not really that small, but it's a script I have running on my server so I can get an idea of system health any time I SSH into it.

33 points

testing is up to date community-testing is up to date multilib-testing is up to date

Wait, I can't be the only one who truly lives on the edge right? I do file bugs up stream, and use Arch on 3 devices, my Desktop, Laptop and Server, all with testing on, the only thing that's broken as of late was the Intel GPU on my Laptop had a regression so it won't initialize correctly, I put a bug up stream, and rolled back to linux-lts, I may be an idiot, but at least I am a smart idiot.

25 points

Not specific to Arch, but I have a custom MOTD that runs from my ZSH profile that essentially checks the status of all the services I run on the local machine and also does the same checks to my Raspberry Pi and checks the services it runs.

Arch

  • Plex

  • Gitea

  • Pi-Hole

  • Deluge

  • OpenVPN

Raspbian

  • Rasp-AP

  • Secondary Pi-Hole

Image

The status symbols can be:

  • Green - OK
  • Yellow - Specific to Update and Gimli means something isn't right, E.G. There is more than 10 updates to be done, or a service on Gimli isn't running.
  • Red - Dead.

I also have a cronjob that will auto move any movie downloaded into a folder of the appropriate year so DLNA compliant clients have a nice time when Plex isn't available.

8 points

[Insert Snarky Comment About Arch Being Bleeding Edge]

That is kinda strange, I dunno why but I thought experimental stuff would go on AUR until deemed "stable" enough to make it to official repos, but I guess this is more Audacity then Arch since they are the ones who made it their primary download.

0 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.