From 5af91843ad31b2dabd6488099111301266d8f90a Mon Sep 17 00:00:00 2001 From: Justine Smithies Date: Mon, 16 Dec 2024 19:12:44 +0000 Subject: freebsd-updates.sh converted from bash to sh. --- .config/eww/scripts/freebsd-updates.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to '.config/eww/scripts') 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 -- cgit v1.2.3