This commit is contained in:
Bob Mottram 2016-11-21 16:00:20 +00:00
parent 5726498f58
commit ebd37f392c
3 changed files with 17 additions and 30 deletions

View File

@ -227,14 +227,7 @@ function irc_set_global_password_base {
function change_password_irc {
new_global_password="$2"
# Change the password for all users
for d in /home/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
${PROJECT_NAME}-pass -u "$USERNAME" -a irc -p "$new_global_password"
fi
done
set_password_for_all_users irc "$new_global_password"
irc_set_global_password_base "$new_global_password"
}
@ -522,13 +515,8 @@ function install_irc_server {
IRC_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
# Change the password for all users
for d in /home/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
${PROJECT_NAME}-pass -u "$USERNAME" -a irc -p "$IRC_PASSWORD"
fi
done
set_password_for_all_users irc "$IRC_PASSWORD"
echo '**************************************************' > /etc/ngircd/motd
echo $'* F R E E D O M B O N E I R C *' >> /etc/ngircd/motd

View File

@ -55,14 +55,7 @@ function install_interactive_mumble {
function change_password_mumble {
new_mumble_password="$2"
# Change the password for all users
for d in /home/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
${PROJECT_NAME}-pass -u "$USERNAME" -a mumble -p "$new_mumble_password"
fi
done
set_password_for_all_users mumble "$new_mumble_password"
sed -i "s|serverpassword=.*|serverpassword=$new_mumble_password|g" /etc/mumble-server.ini
systemctl restart mumble-server
}
@ -268,13 +261,7 @@ function install_mumble {
update_default_domain
systemctl restart mumble-server
# Change the password for all users
for d in /home/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
${PROJECT_NAME}-pass -u "$USERNAME" -a mumble -p "$MUMBLE_SERVER_PASSWORD"
fi
done
set_password_for_all_users mumble "$MUMBLE_SERVER_PASSWORD"
function_check configure_firewall_for_mumble
configure_firewall_for_mumble

View File

@ -242,4 +242,16 @@ function interactive_key_recovery {
fi
}
function set_password_for_all_users {
app_name="$1"
change_password="$2"
for d in /home/*/ ; do
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
${PROJECT_NAME}-pass -u "${USERNAME}" -a "${app_name}" -p "${change_password}"
fi
done
}
# NOTE: deliberately there is no "exit 0"