Skip to content

Instantly share code, notes, and snippets.

@thodoris85
Last active May 7, 2021 02:47
Show Gist options
  • Save thodoris85/b736d287899e48c36b3f81d795c0adc7 to your computer and use it in GitHub Desktop.
Save thodoris85/b736d287899e48c36b3f81d795c0adc7 to your computer and use it in GitHub Desktop.
if [ ! -w /var/www/html/admin/scripts/pi-hole/php/header.php ]; then
echo ROOT OR GTFO
fi
cd /var/www/html/admin || exit 1
cat <<'EOF' > pihole.uptime.patch
diff --git a/scripts/pi-hole/php/header.php b/scripts/pi-hole/php/header.php
--- a/scripts/pi-hole/php/header.php
+++ b/scripts/pi-hole/php/header.php
@@ -312,3 +312,5 @@ if($auth) {
<div class="pull-left image">
+ <p></p>
<img src="img/logo.svg" alt="Pi-hole logo" width="45" height="67" style="height: 67px;">
+ <p></p>
</div>
@@ -351,6 +351,10 @@ if($auth) {
echo '<span id=\"temperature\"><i class="fa fa-circle text-red"></i> FTL offline</span>';
}
?>
+ <br />
+ <?php
+ echo '<span id="status"><i class="fa fa-circle text-green-light"></i> '.exec('uptime --pretty').'</a>';
+ ?>
<br/>
<?php
echo "<span title=\"Detected $nproc cores\"><i class=\"fa fa-circle ";
EOF
git apply --ignore-space-change --ignore-whitespace pihole.uptime.patch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment