-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzypper-dup-wrapper
37 lines (32 loc) · 1.03 KB
/
zypper-dup-wrapper
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
# zypper wrapper for Tumbleweed updater KDE plasmoid
if [ "$1" == "check" ]
then
zypper --xmlout dup --force-resolution --auto-agree-with-licenses --dry-run | tee /tmp/twupdater/twupdater-check-xml-out
exitcode="${PIPESTATUS[0]}"
# Logging
if [ "$2" == "logs" ]
then
/bin/cp -p /tmp/twupdater/twupdater-check-xml-out /tmp/twupdater/twupdater-check-xml-out_${exitcode}_$(date +%Y-%m-%d.%H%M%S).log
fi
echo "<exitcode>${exitcode}</exitcode>" >> /tmp/twupdater/twupdater-check-xml-out
elif [ "$1" == "install" ]
then
param=""
if [ "$2" == "autoresolve" ]
then
param="$param --force-resolution"
fi
if [ "$3" == "autolicense" ]
then
param="$param --auto-agree-with-licenses"
fi
zypper --xmlout dup${param} | tee /tmp/twupdater/twupdater-xml-out
exitcode="${PIPESTATUS[0]}"
# Logging
if [ "$4" == "logs" ]
then
/bin/cp -p /tmp/twupdater/twupdater-xml-out /tmp/twupdater/twupdater-xml-out_${exitcode}_$(date +%Y-%m-%d.%H%M%S).log
fi
echo "<exitcode>${exitcode}</exitcode>" >> /tmp/twupdater/twupdater-xml-out
fi