From ae34e8d144594c8de844777f3d8d00e393e63f11 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 5 Apr 2016 09:47:04 +0100 Subject: [PATCH] Show irc password on admin control panel --- src/freedombone-controlpanel | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/freedombone-controlpanel b/src/freedombone-controlpanel index 172722a2..7a53a5a0 100755 --- a/src/freedombone-controlpanel +++ b/src/freedombone-controlpanel @@ -632,6 +632,12 @@ function change_password { --msgbox $"Password for $SELECTED_USERNAME was changed" 6 40 } +function irc_show_password { + IRC_PASSWORD=$(cat /etc/ngircd/ngircd.conf | grep "Password =" | head -n 1 | awk -F '=' '{print $2}') + dialog --title $"IRC Password" \ + --msgbox "$IRC_PASSWORD" 4 40 +} + function irc_set_global_password { dialog --title $"IRC Password" \ --clear \ @@ -1834,8 +1840,9 @@ function menu_irc { --title $"IRC Menu" \ --radiolist $"Choose an operation:" 14 70 4 \ 1 $"Set a password for all IRC users" off \ - 2 $"Access via the onion address" off \ - 3 $"Exit" on 2> $data + 2 $"Show current IRC login password" off \ + 3 $"Access via the onion address" off \ + 4 $"Exit" on 2> $data sel=$? case $sel in 1) break;; @@ -1843,8 +1850,9 @@ function menu_irc { esac case $(cat $data) in 1) irc_set_global_password;; - 2) irc_via_onion;; - 3) break;; + 2) irc_show_password;; + 3) irc_via_onion;; + 4) break;; esac done }