summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/bsdconfig/networking/share/device.subr6
-rw-r--r--usr.sbin/bsdconfig/share/common.subr21
2 files changed, 23 insertions, 4 deletions
diff --git a/usr.sbin/bsdconfig/networking/share/device.subr b/usr.sbin/bsdconfig/networking/share/device.subr
index d067bf1..0122768 100644
--- a/usr.sbin/bsdconfig/networking/share/device.subr
+++ b/usr.sbin/bsdconfig/networking/share/device.subr
@@ -436,8 +436,7 @@ f_dialog_menu_netdev_edit()
"$options" != "$options_orig" -o \
"$dhcp" != "$dhcp_orig" ]
then
- f_dialog_info "$( printf "$msg_saving_network_interface" \
- "$interface" )"
+ f_show_info "$msg_saving_network_interface" "$interface"
local value=
if [ "$dhcp" ]; then
@@ -458,8 +457,7 @@ f_dialog_menu_netdev_edit()
f_dialog_yesno "Would you like to bring the $interface" \
"interface up right now?"
if [ $? -eq $SUCCESS ]; then
- f_dialog_info "$( printf "$msg_bring_interface_up" \
- "$interface" )"
+ f_show_info "$msg_bring_interface_up" "$interface"
local dr="$( f_sysrc_get defaultrouter )" err
if [ "$dr" = "NO" -o ! "$dr" ]; then
diff --git a/usr.sbin/bsdconfig/share/common.subr b/usr.sbin/bsdconfig/share/common.subr
index 8bf552a..4c53e49 100644
--- a/usr.sbin/bsdconfig/share/common.subr
+++ b/usr.sbin/bsdconfig/share/common.subr
@@ -136,6 +136,27 @@ f_interrupt()
f_die
}
+# f_show_info $fmt [ $opts ... ]
+#
+# Display a message in a dialog infobox using printf(1) syntax.
+#
+f_show_info()
+{
+ local msg
+ msg=$( printf "$@" )
+
+ #
+ # Use f_dialog_infobox from dialog.subr if possible, otherwise fall
+ # back to dialog(1) (without options, making it obvious when using
+ # un-aided system dialog).
+ #
+ if f_have f_dialog_info; then
+ f_dialog_info "$msg"
+ else
+ dialog --infobox "$msg" 0 0
+ fi
+}
+
# f_show_msg $fmt [ $opts ... ]
#
# Display a message in a dialog box using printf(1) syntax.
OpenPOWER on IntegriCloud