Created
December 8, 2020 08:21
-
-
Save letroll/b75eedef72d109dc9bb8d15e28ca120b to your computer and use it in GitHub Desktop.
[changement de mot de passe] changement de mot de passe dans une liste de fichier #password #bash #script #proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function replaceDas(){ | |
file_list=( | |
/c/Users/UserName/.leptonrc | |
) | |
search=${1} | |
replace=${2} | |
echo "replace $search to $replace" | |
echo "in" | |
for filename in "${file_list[@]}"; | |
do | |
echo "$filename"; | |
sed -i.bak "s/$search/$replace/g" $filename; | |
done | |
} | |
function updateDas(){ | |
read -p "Enter the old password value: " o | |
read -p "Enter the new password value: " n | |
replaceDas $o $n | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment