You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've changed passwords used for accessing MUSIT datasets on the main IPT. For posterity - here is a process:
access the /srv/ipt/ on the IPT and check the encoded password string in one MUSIT dataset (for example o_vascular) in /srv/ipt/resources/o_vascular/resources.xml. It will in tag. Store this old encoded password somewhere.
Change the password with IPT UI to the new one
Check the resources.xml again and copy the new encoded password
Create,chmod +x and run a new bash script in /srv/ipt/change_pwd.sh
#!/bin/bash
OLD_PASSWORD="old_endoded_pwd"
NEW_PASSWORD="new_endoded_pwd"# Find all resource.xml files and process them
find resources -name "resource.xml" -type f |whileread -r file;doif grep -q "$OLD_PASSWORD""$file";then# Create backup first
cp "$file""${file}.bak"# Perform the replacement and capture if any changes were madeif sed -i "s|$OLD_PASSWORD|$NEW_PASSWORD|g""$file";thenecho"Updated password in: $file"fifidone
The text was updated successfully, but these errors were encountered:
The -i option of sed can use a suffix to automatically create a backup copy when doing an in place replacement (at least on the GNU version).
Even if using sed could be quite safe in this specific case, I would suggest not doing a global find-and-replace over the entire file, but target a specific field, using an XML parser. jq is rather popular for handling json files, but there are wrappers around to handle yaml and xml files as well, provided by yq.
I've changed passwords used for accessing MUSIT datasets on the main IPT. For posterity - here is a process:
/srv/ipt/
on the IPT and check the encoded password string in one MUSIT dataset (for exampleo_vascular
) in/srv/ipt/resources/o_vascular/resources.xml
. It will inresources.xml
again and copy the new encoded passwordThe text was updated successfully, but these errors were encountered: