getAdminPassword for shared password/TOTP

This commit is contained in:
Bandie 2022-10-25 18:54:32 +02:00
parent b8528ab6eb
commit ce973458a1
Signed by: Bandie
GPG Key ID: 7FA4FD7D1D7997C2
1 changed files with 11 additions and 3 deletions

14
diaspora-mod Normal file → Executable file
View File

@ -4,6 +4,12 @@ BT="yipyap.social"
h=8 h=8
w=60 w=60
function showAdminPassword(){
clear
/home/diaspora/adminpw
read -n 1 -p "Press any key to continue."
}
function getBoolSetting(){ function getBoolSetting(){
[ "$(cat "$CONFIG" | grep "$1 =" | awk '{ print $3 }')" = "true" ] && echo "on" || echo "off" [ "$(cat "$CONFIG" | grep "$1 =" | awk '{ print $3 }')" = "true" ] && echo "on" || echo "off"
} }
@ -26,9 +32,6 @@ function setBoolSetting(){
sudo -u diaspora sed -i "s/open = .*/open = $Invites/" "$CONFIG" sudo -u diaspora sed -i "s/open = .*/open = $Invites/" "$CONFIG"
sudo -u diaspora sed -i "s/enable_registrations = .*/enable_registrations = $Registrations/" "$CONFIG" sudo -u diaspora sed -i "s/enable_registrations = .*/enable_registrations = $Registrations/" "$CONFIG"
} }
function setInvitesToZeroForUser(){ function setInvitesToZeroForUser(){
@ -81,6 +84,7 @@ function menu(){
2 "Remove invites from user" \ 2 "Remove invites from user" \
3 "Restart Webservice" \ 3 "Restart Webservice" \
4 "Restart Sidekiq" \ 4 "Restart Sidekiq" \
5 "Show admin password" \
3>&1 1>&2 2>&3 3>&1 1>&2 2>&3
) )
@ -130,6 +134,10 @@ function menu(){
rm /tmp/mod_state rm /tmp/mod_state
menu menu
;; ;;
5)
showAdminPassword
menu
;;
*) *)
;; ;;
esac esac