aboutsummaryrefslogtreecommitdiff
path: root/systemctl
diff options
context:
space:
mode:
Diffstat (limited to 'systemctl')
-rwxr-xr-xsystemctl23
1 files changed, 13 insertions, 10 deletions
diff --git a/systemctl b/systemctl
index 93bdcd6..37e876e 100755
--- a/systemctl
+++ b/systemctl
@@ -4,33 +4,35 @@
# /usr/bin/hostnamectl
# /usr/bin/systemd-detect-virt
# Author: bgstack15@gmail.com
+# Author: davidpaul@librem.one
# Startdate: 2020-01-10 13:02:14
# SPDX-License-Identifier: CC-BY-SA-4.0
-# Title:
-# Purpose:
+# Title:
+# Purpose:
# Package: systemctl-service-shim
-# History:
+# History:
# 2020-05-14 place framework.sh contents inline so as not to depend on it.
# 2021-01-10 adapted for inclusion in devuan-sanity
# 2021-10-20 add /bin/systemctl symlink control logic
# 2022-07-12 Convert try-restart to restart
# 2022-07-14 Add preset, which runs update-rc.d ${service} defaults
# 2023-02-11 Add /usr/bin/systemctl symlink control
-# Usage:
+# 2024-03-08 Replace moreutils usage with POSIX shell
+# Usage:
# Should be mostly like systemctl from systemd.
# Reference: ftemplate.sh 2019-05-02a ; framework.sh 2018-05-02a
# man 1 systemctl
# Improve:
# Return 1 if status output is failed
# Dependencies:
-# req-devuan: moreutils
+# req-devuan:
# Documentation:
# Be aware that real systemd systemctl is file /bin/systemctl but
# this systemdtl is file /usr/sbin/systemctl to prevent a recursive loop
# in some service scripts that look for /bin/systemctl
# vim: set sw=3 sts=3 ts=3 et:
fiversion="2019-05-02a"
-systemctlversion="2023-02-11a"
+systemctlversion="2024-03-18a"
usage() {
${PAGER:-/usr/bin/less -F} >&2 <<ENDUSAGE
@@ -233,12 +235,13 @@ setval() {
}
flecho() {
- # requires moreutils
- if echo "${@}" | grep -qiE '.' ;
+ date -u +[%Y-%m-%dT%TZ] | tr -d '\n'
+ printf "%s@%s" "${USER}" "${server}"
+ if echo "${@}" | grep -q '.' ;
then
- printf "%s\n" "${@}" | TZ=UTC ts "[%FT%TZ]${USER}@${server}:"
+ printf ":%s\n" "${@}"
else
- printf '' | TZ=UTC ts "[%FT%TZ]${USER}@${server}"
+ printf "\n"
fi
}
bgstack15