dist/obs/attribute-update: provide script for updating attribute definitions.
This commit is contained in:
parent
4d09eda65d
commit
45e0989b28
23
dist/obs/attribute-update
vendored
Executable file
23
dist/obs/attribute-update
vendored
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ $# -ne 2 ] ; then
|
||||||
|
echo "usage: $(basename "$0") <APIURL> <group>"
|
||||||
|
echo
|
||||||
|
echo " ./attribute-update obs factory-staging"
|
||||||
|
echo " ./attribute-update ibs sle-staging-managers"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
for file in *.xml ; do
|
||||||
|
read -p "update $(basename "$file")? [y/n]: " response
|
||||||
|
if [ "$response" != "y" ] ; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
temp="/tmp/$(basename "$file")"
|
||||||
|
sed "5i<modifiable_by group='$2'/>" "$file" > "$temp"
|
||||||
|
path="$(basename "$file" | sed 's|:|/|' | sed 's|.xml||')"
|
||||||
|
echo "PUT /attribute/$path/_meta"
|
||||||
|
osc -A "$1" api -X PUT -T "$temp" "/attribute/$path/_meta"
|
||||||
|
rm "$temp"
|
||||||
|
done
|
Loading…
x
Reference in New Issue
Block a user