diff options
author | Justine Smithies <justine@smithies.me.uk> | 2024-12-16 19:12:44 +0000 |
---|---|---|
committer | Justine Smithies <justine@smithies.me.uk> | 2024-12-16 19:12:44 +0000 |
commit | 5af91843ad31b2dabd6488099111301266d8f90a (patch) | |
tree | b4b7a3e9c1330c99d4e4564de7a1478c3d2dcbe6 /.config | |
parent | efba7b8280c2b73354704ce9389e60bf5e951756 (diff) |
freebsd-updates.sh converted from bash to sh.
Diffstat (limited to '.config')
-rwxr-xr-x | .config/eww/scripts/freebsd-updates.sh | 14 |
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 |