From patchwork Mon May 20 09:05:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonatan Schlag X-Patchwork-Id: 7786 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4VjWs409xDz3wxG for ; Mon, 20 May 2024 09:06:32 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4VjWs20bjyz3B3; Mon, 20 May 2024 09:06:30 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4VjWs203VNz331V; Mon, 20 May 2024 09:06:30 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4VjWrz1JCcz32W4 for ; Mon, 20 May 2024 09:06:27 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4VjWry1fhGzXY; Mon, 20 May 2024 09:06:26 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1716195986; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=496lRWQep/rWLT+vUq0AWrupTThbzM+E0hy+yWfeFhg=; b=Vu76yyEXug6mxRgy27qSGqWBY7oFEVsXyTcojvvoVoaeAHNnEgJBoX9Wb1JGKVvbX3RUUk ovQiQQRxD/YrHdBQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1716195986; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=496lRWQep/rWLT+vUq0AWrupTThbzM+E0hy+yWfeFhg=; b=ux+mj27JD68osO7h93TjVpBuVyCga6fb/WoVdmxAtRyxH6EsIZJUQTxAP+1/uXVRXcCTlt JMb9qB99ksOoL2SD/loEHie3L53wbS8jofHDdiYsV9QwlkBEb0A7BzRgU3J0Gypr13D/bD /2rgHcbxbMrHv7mb2fu9N+o+YE76HxLVGF4BdqjKINLYKkF5loPXaFTVOJHlUBP4TiROPS bqrn6GL2fdnL5u2uGHPPgOnc+w1yJeWwplgH9fFBY+GwUpaxiuSgBdrisUg2vbJ8YHBnc9 ido76Xjn3DYWwi/mkAl0D9/S41THSsdzfmBolXaxA0mkXM1BLB6TX/tjPbAYQg== From: Jonatan Schlag To: development@lists.ipfire.org Subject: [PATCH 01/21] test: Add bash lib for colors Date: Mon, 20 May 2024 11:05:51 +0200 Message-Id: <20240520090611.10406-2-jonatan.schlag@ipfire.org> In-Reply-To: <20240520090611.10406-1-jonatan.schlag@ipfire.org> References: <20240520090611.10406-1-jonatan.schlag@ipfire.org> MIME-Version: 1.0 Message-ID-Hash: CSVWJ6S3S27T2KG5CHOBCOBJ5L66RHVG X-Message-ID-Hash: CSVWJ6S3S27T2KG5CHOBCOBJ5L66RHVG X-MailFrom: jonatan.schlag@ipfire.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: IPFire development talk Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: This is borrowed from here: https://git.ipfire.org/?p=network.git;a=blob;f=src/functions/functions.colors;h=0bd6f97177c366f1d1ee4553043ae719430acdb2;hb=refs/heads/master Signed-off-by: Jonatan Schlag --- tests/lib_color.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 tests/lib_color.sh diff --git a/tests/lib_color.sh b/tests/lib_color.sh new file mode 100644 index 000000000..6ca1c9864 --- /dev/null +++ b/tests/lib_color.sh @@ -0,0 +1,43 @@ +#!/usr/bin/bash + +# Regular colours +CLR_BLACK_R='\e[0;30m' +CLR_RED_R='\e[0;31m' +CLR_GREEN_R='\e[0;32m' +CLR_YELLOW_R='\e[0;33m' +CLR_BLUE_R='\e[0;34m' +CLR_PURPLE_R='\e[0;35m' +CLR_CYAN_R='\e[0;36m' +CLR_WHITE_R='\e[0;37m' + +# Bold colours +CLR_BLACK_B='\e[1;30m' +CLR_RED_B='\e[1;31m' +CLR_GREEN_B='\e[1;32m' +CLR_YELLOW_B='\e[1;33m' +CLR_BLUE_B='\e[1;34m' +CLR_PURPLE_B='\e[1;35m' +CLR_CYAN_B='\e[1;36m' +CLR_WHITE_B='\e[1;37m' + +# Background colors +CLR_BLACK_BG='\e[40m' +CLR_RED_BG='\e[41m' +CLR_GREEN_BG='\e[42m' +CLR_YELLOW_BG='\e[43m' +CLR_BLUE_BG='\e[44m' +CLR_PURPLE_BG='\e[45m' +CLR_CYAN_BG='\e[46m' +CLR_WHITE_BG='\e[47m' + +# Font decoration +FONT_RESET="\e[0m" +FONT_BOLD="\e[1m" +FONT_UNDERLINED="\e[4m" +FONT_BLINKING="\e[5m" +FONT_INVERTED="\e[7m" + +# Reset everything +CLR_RESET="${FONT_RESET}" + +