Skip to content

Instantly share code, notes, and snippets.

@letroll
Created December 8, 2020 08:21
Show Gist options
  • Save letroll/b75eedef72d109dc9bb8d15e28ca120b to your computer and use it in GitHub Desktop.
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
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