Merge lp:~cpe-sa/obinstall/fix-eula into lp:obinstall/next

Proposed by Matt Jarvis
Status: Needs review
Proposed branch: lp:~cpe-sa/obinstall/fix-eula
Merge into: lp:obinstall/next
Diff against target: 38 lines (+24/-7)
1 file modified
network/winbox.sh (+24/-7)
To merge this branch: bzr merge lp:~cpe-sa/obinstall/fix-eula
Reviewer Review Type Date Requested Status
CPE SA Pending
Review via email: mp+314548@code.launchpad.net

Description of the change

Fix EULA popup, add code to force sudo since we're installing packages, add some error handling, fix launching of application

To post a comment you must log in.

Unmerged revisions

20. By Matt Jarvis <email address hidden>

Fix EULA, re-factor and fix launching of winbox application

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'network/winbox.sh'
2--- network/winbox.sh 2016-06-15 13:49:54 +0000
3+++ network/winbox.sh 2017-01-11 17:33:47 +0000
4@@ -21,11 +21,28 @@
5
6 # set -x
7
8-if ! dpkg -l | grep -q 'wine ' ; then sudo apt-get install -qy wine; fi
9-
10-wget -qc http://download2.mikrotik.com/routeros/winbox/3.4/winbox.exe -O ~/winbox.exe
11-
12-echo Running winbox under wine, all log messages written to /tmp/wine-winbox.log
13-
14-cd /tmp && wine ~/winbox.exe &> /tmp/wine-winbox.log
15+# If user is not root then exit
16+#
17+if [ "$(id -u)" != "0" ]; then
18+ echo "Must be run with sudo or by root"
19+ exit 77
20+fi
21+
22+# Fix EULA popup for MS Fonts
23+echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | sudo debconf-set-selections
24+
25+if ! dpkg -l | grep -q 'wine ';then
26+ if ! apt-get install -qy wine; then
27+ echo "Could not install wine"
28+ exit 1
29+ fi
30+fi
31+
32+if ! wget -qc http://download2.mikrotik.com/routeros/winbox/3.4/winbox.exe -O ~/winbox.exe;then
33+ echo "Could not download winbox.exe"
34+ exit 1
35+fi
36+
37+echo "Running winbox under wine, all log messages written to /tmp/wine-winbox.log"
38+cd /tmp && su - ubuntu -c "wine /home/ubuntu/winbox.exe &> /tmp/wine-winbox.log"
39

Subscribers

People subscribed via source and target branches

to all changes: