Univention Bugzilla – Attachment 6719 Details for
Bug 36711
Package lists allow to remove essential packages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
bug36711.sh
bug36711 (text/plain), 1.22 KB, created by
Florian Best
on 2015-02-25 14:25:45 CET
(
hide
)
Description:
bug36711.sh
Filename:
MIME Type:
Creator:
Florian Best
Created:
2015-02-25 14:25:45 CET
Size:
1.22 KB
patch
obsolete
>#!bin/bash ># get all defined packages >univention-ldapsearch univentionObjectType=settings/packages univentionPackageDefinition -xLLL | sort | uniq | grep univentionPackageDefinition: | sed 's/univentionPackageDefinition: //' > all_packages > ># authenticate at UMC >COOKIEJAR="$(mktemp)"; >username=Administrator; >password=univention; >host=10.200.27.6; >curl -s --cookie "$COOKIEJAR" --cookie-jar "$COOKIEJAR" -H "Content-Type: application/json" -d '{"options":{"username":"'"$username"'","password":"'"$password"'"}}' "http://$host/umcp/auth" > ># script to parse json >cat > packages.py <<EOL >import json, sys; >data = json.loads(sys.stdin.read())['result']; >if data['broken']: > print(data['broken']); >removed = [d for d in data['remove'] if d.startswith('univention') or d.startswith('ucs')] >if removed: > print('removing %s would also remove: %s' % (sys.argv[1], ' '.join(removed),)); > print >EOL > ># query each packages which would uninstall UCS >while read line; do > curl -s --cookie "$COOKIEJAR" --cookie-jar "$COOKIEJAR" -H "Content-Type: application/json" -d '{"options":{"function":"uninstall","packages":["'"$line"'"]}}' "http://$host/umcp/command/appcenter/packages/invoke/test" | python -m json.tool | python packages.py "$line" >done < all_packages > >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 36711
: 6719 |
6720