Community discussions

MikroTik App
 
en1gm4
Member Candidate
Member Candidate
Topic Author
Posts: 123
Joined: Sun Oct 02, 2016 6:27 pm
Location: UK

7.1.1 script formatting in winbox

Fri Jan 21, 2022 6:52 pm

Does anyone else see an issue with script formatting not working in winbox in 7.1.1.?
I just upgraded to 7.1.1 from 6.49.1 and the formatting is all gone in the scripts in winbox but it looks fine on a browser with webfig
I am running whatever the latest winbox is.
 
en1gm4
Member Candidate
Member Candidate
Topic Author
Posts: 123
Joined: Sun Oct 02, 2016 6:27 pm
Location: UK

Re: 7.1.1 script formatting in winbox

Fri Jan 28, 2022 1:33 pm

fyi, this has been raised with Mikrotik support (SUP-72676)
at the moment they indicate they are unable to reproduce it.
(the results are the same on my device for a script that was there already before the upgrade to 7.1.1 and for scripts added afterward)
 
Sob
Forum Guru
Forum Guru
Posts: 9188
Joined: Mon Apr 20, 2009 9:11 pm

Re: 7.1.1 script formatting in winbox

Fri Jan 28, 2022 3:21 pm

Could you describe or show what the issue is?
 
en1gm4
Member Candidate
Member Candidate
Topic Author
Posts: 123
Joined: Sun Oct 02, 2016 6:27 pm
Location: UK

Re: 7.1.1 script formatting in winbox

Fri Jan 28, 2022 3:27 pm

this is what i see in winbox
script winbox.png
this is from a web browser
script web.png
You do not have the required permissions to view the files attached to this post.
 
Sob
Forum Guru
Forum Guru
Posts: 9188
Joined: Mon Apr 20, 2009 9:11 pm

Re: 7.1.1 script formatting in winbox

Fri Jan 28, 2022 4:01 pm

It's most likely Unix line endings. Do /system/script/export and check if you see \r\n (Windows) or just \n (Unix).
 
en1gm4
Member Candidate
Member Candidate
Topic Author
Posts: 123
Joined: Sun Oct 02, 2016 6:27 pm
Location: UK

Re: 7.1.1 script formatting in winbox

Fri Jan 28, 2022 4:06 pm

thanks
i only see \n\

strange that webfig would handle it fine but not winbox (especially as winbox used to handle it fine before 7.1.1)
hopefully an easy fix for the Mikrotik team
 
Sob
Forum Guru
Forum Guru
Posts: 9188
Joined: Mon Apr 20, 2009 9:11 pm

Re: 7.1.1 script formatting in winbox

Fri Jan 28, 2022 4:09 pm

WinBox saves with Windows line endings.
WebFig saves with Unix line ending.
Script editor in CLI (/system/script/edit <script name> source) also saves with Unix line ending (please mention this too when you write them).
 
en1gm4
Member Candidate
Member Candidate
Topic Author
Posts: 123
Joined: Sun Oct 02, 2016 6:27 pm
Location: UK

Re: 7.1.1 script formatting in winbox

Fri Jan 28, 2022 4:51 pm

have let support know to look here
I would have thought/hoped the old CR/LF had gone away a decade or two ago! ;)
 
en1gm4
Member Candidate
Member Candidate
Topic Author
Posts: 123
Joined: Sun Oct 02, 2016 6:27 pm
Location: UK

Re: 7.1.1 script formatting in winbox

Mon Jan 31, 2022 1:52 pm

Support has been unable to reproduce it:

I see the same results on two different windows devices on my network though

I just tested pasting the script into winbox and it formats fine in both. However, when I take the same script from the same clipboard (so identical content) and paste it into webfig it loses all formatting in winbox (which makes me think winbox may indeed have the issue with Linux formatting)

I guess one answer is to write/paste your scripts in winbox? I don't know what happens with command line
 
Sob
Forum Guru
Forum Guru
Posts: 9188
Joined: Mon Apr 20, 2009 9:11 pm

Re: 7.1.1 script formatting in winbox

Mon Jan 31, 2022 2:25 pm

I wonder how they managed to not reproduce it, it's clearly there:
/system script
add dont-require-permissions=no name="script saved using winbox" owner=sob policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source="line1\r\
    \nline2\r\
    \nline3"
add dont-require-permissions=no name="script saved using webfig" owner=sob policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source="line1\
    \nline2\
    \nline3"
add dont-require-permissions=no name="script saved using cli editor" owner=sob policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source="line1\
    \nline2\
    \nline3"
\r\n when saved in WinBox, \n otherwise.
 
elico
Member Candidate
Member Candidate
Posts: 158
Joined: Mon Nov 07, 2016 3:23 am

Re: 7.1.1 script formatting in winbox

Mon Jan 31, 2022 6:48 pm

I wonder how they managed to not reproduce it, it's clearly there:
Well it's pretty easy to reproduce with webfig when creating a new script on 7.1.1.
I have tried creating a simple script with 5 lines and while on webfig when writing and editing it looks fine, in winbox and on export it has line ending with \r\n.
I cannot believe that MT support will say that they didn't managed to re-produce it.
 
Sob
Forum Guru
Forum Guru
Posts: 9188
Joined: Mon Apr 20, 2009 9:11 pm

Re: 7.1.1 script formatting in winbox

Mon Jan 31, 2022 8:37 pm

And did they write what exact part they can't reproduce? Do they get consistent line endings no matter where they save script? Or does their WinBox show both types of line endings correctly?
 
oskarsk
MikroTik Support
MikroTik Support
Posts: 64
Joined: Mon May 13, 2019 9:41 am

Re: 7.1.1 script formatting in winbox

Wed Feb 02, 2022 1:58 pm

We managed to reproduce this, thanks. Please, when sending reports to us make sure to include accurate description on how to reproduce issue.

Who is online

Users browsing this forum: jfulton, Mtikguy, yhfung and 21 guests