From 818dabae65e67cb52f11623ab1e76ad4c85c19e1 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 13 Aug 2023 02:08:33 +0200 Subject: added confirm, trl and wipe scripts! --- bin/extra/confirm | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 bin/extra/confirm (limited to 'bin/extra/confirm') diff --git a/bin/extra/confirm b/bin/extra/confirm new file mode 100755 index 0000000..116b468 --- /dev/null +++ b/bin/extra/confirm @@ -0,0 +1,12 @@ +#!/bin/sh + +read_char () +{ + old_stty_cfg=$(stty -g 2> /dev/null) + stty raw -echo 2> /dev/null + dd ibs=1 count=1 2> /dev/null + stty $old_stty_cfg 2> /dev/null +} + +>&2 printf "$1 " +read_char | grep -q "[yY]" -- cgit v1.2.3