aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.config/eww/scripts/freebsd-updates.sh14
1 files changed, 7 insertions, 7 deletions
diff --git a/.config/eww/scripts/freebsd-updates.sh b/.config/eww/scripts/freebsd-updates.sh
index aadb5cf..7887522 100755
--- a/.config/eww/scripts/freebsd-updates.sh
+++ b/.config/eww/scripts/freebsd-updates.sh
@@ -1,6 +1,6 @@
-#!/usr/bin/env bash
+#!/bin/sh
-function CheckUpdates() {
+CheckUpdates() {
pkg upgrade -n | awk '/Installed packages to be UPGRADED:/{p=1}/^ *$/{p=0}p' | tail -n +2 1> /tmp/freebsd-updates
updates="$(cat /tmp/freebsd-updates | awk '{ print $1 }')"
number=$(cat /tmp/freebsd-updates | wc -l | xargs)
@@ -14,12 +14,12 @@ fi
echo "$text"
}
-function RefreshUpdates() {
+RefreshUpdates() {
value="$(CheckUpdates)"
eww update freebsd-updates="$value"
}
-function Update() {
+Update() {
foot bash -c 'doas pkg upgrade'
RefreshUpdates
}
@@ -27,12 +27,12 @@ function Update() {
case "$1" in
Refresh)
RefreshUpdates
- exit 0
+ exit 0
;;
Update)
Update
- exit 0
- ;;
+ exit 0
+ ;;
*)
CheckUpdates
exit 0