From 6d616ec188f9dd66c83e15904a7b9fc7130eb6c0 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 6 Jul 2023 12:16:56 +0200 Subject: [is] New module --- modules/is.inc | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 modules/is.inc diff --git a/modules/is.inc b/modules/is.inc new file mode 100644 index 0000000..17e8a0d --- /dev/null +++ b/modules/is.inc @@ -0,0 +1,6 @@ +#!/bin/ash + +is_on() { + [ "$1" = "ON" ] || [ "$1" = "on" ] || [ "$1" = "YES" ] || [ "$1" = "yes" ] || [ "$1" = "true" ] || [ "$1" = "TRUE" ] || [ "$1" -ne 0 ] 2>/dev/null || return 1 + return 0 +} -- cgit v1.2.3-55-g7522