aboutsummaryrefslogtreecommitdiff
path: root/scripts/bbconfirm
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2020-02-24 03:39:44 -0800
committerBruce Hill <bruce@bruce-hill.com>2020-02-24 03:39:44 -0800
commit88fd9c416be0f5fe1e5fd48ba7c27d4d1e25261c (patch)
treecfe311fb81c1d12e46b08de175a6296f0aed7a0d /scripts/bbconfirm
parent304cbddf730b86dec2b3d7c414fd0b9a38c69d76 (diff)
Moved bbstartup into a script, renamed helper/ -> scripts/, and added
bbshutdown script. Also tweaked some of the precedence.
Diffstat (limited to 'scripts/bbconfirm')
-rwxr-xr-xscripts/bbconfirm9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/bbconfirm b/scripts/bbconfirm
new file mode 100755
index 0000000..cae1153
--- /dev/null
+++ b/scripts/bbconfirm
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Ask for user confirmation
+set -e
+if command -v ask >/dev/null; then
+ ask -n "$(printf "$1Is that okay?\033[?25h")"
+else
+ reply="$(bbask -1 "$(printf "$1\033[0;1mIs that okay? [y/N] ")")"
+ [ "$reply" != 'y' ]
+fi