Magerange Posted April 26, 2017 Posted April 26, 2017 Hi! I would need some help with CLI for Linux based VPS So I wrote CLI code on my Windows based laptop as '.bat' file. Now I would like to import it to my Linux based VPS. What should I configure and how I should run the file? Thanks
Muffins Posted April 26, 2017 Posted April 26, 2017 You can't run a batch file on linux, you need to create a .sh (shell) file . If you need help I can get on team viewer and show you how , just come to the chatbox. 1
Magerange Posted April 26, 2017 Author Posted April 26, 2017 13 minutes ago, Muffins said: You can't run a batch file on linux, you need to create a .sh (shell) file . If you need help I can get on team viewer and show you how , just come to the chatbox. Lol, alright. I hope this is not a meme.
THS Posted April 26, 2017 Posted April 26, 2017 (edited) Just put it all the same info into another text editor like nano, save as a .sh Depending on OS execute using (for example on 16.04) bash scriptname.sh Edited April 26, 2017 by THS 1
Hi G00gle Posted April 26, 2017 Posted April 26, 2017 22 minutes ago, THS said: Just put it all the same info into another text editor like nano, save as a .sh Depending on OS execute using (for example on 16.04) bash scriptname.sh Don't forget to chmod it first. chmod +x filename.sh Then run it: ./filename.sh 2
Muffins Posted April 26, 2017 Posted April 26, 2017 Just now, Hi G00gle said: Don't forget to chmod it first. chmod +x filename.sh Then run it: ./filename.sh ^^ 1
Magerange Posted April 28, 2017 Author Posted April 28, 2017 (edited) Guys, I have another strange issue. I have written a script that executes the commands and works on Linux. However, it has issues with SDN script parameter command execution. Quote -script: x;parameter1;paramater2;.... In terminal I get message 'command not found' for each line where is paramater for script options. In OSBot terminal (not that it really matters, but still) I get 'wrong amount of parameters'. I am ready to bet my both testicles that parameters are correctly input. Probably the strangest part is that the same code works 100% on my Windows pc. And no, I haven't just ctrl+c;ctrl+v the code (found that was an issue sometimes when configuring .bat to .sh). Any ideas...? Edited April 28, 2017 by Magerange
thechuck Posted April 28, 2017 Posted April 28, 2017 Lol you dont need .sh appended to the filename of the script. If you would like to post your batch file I can help you convert it into a bash script. from terminal vi filename press i for insert mode to start typing #!/bin/bash <-- this tells the script what shell you will be using. enter your bash commands press esc then :wq to write/quit the file chmod +x filename ./path/to/filename ---- don't forget the . in the beginning MageRange add me on skype I can help you out. chuckgreve2012@gmail.com also, I wouldn't bet your testicles on that bahaha.
Magerange Posted April 28, 2017 Author Posted April 28, 2017 (edited) 8 minutes ago, thechuck said: Lol you dont need .sh appended to the filename of the script. If you would like to post your batch file I can help you convert it into a bash script. from terminal vi filename press i for insert mode to start typing #!/bin/bash <-- this tells the script what shell you will be using. enter your bash commands press esc then :wq to write/quit the file chmod +x filename ./path/to/filename ---- don't forget the . in the beginning MageRange add me on skype I can help you out. chuckgreve2012@gmail.com also, I wouldn't bet your testicles on that bahaha. I've done all that and as I said - CLI works up untill 'script parameter' part for an SDN script. That is the only issue with the cli script - it does not recognize script parameters on Linux, but does on Windows for the same code, same input (eventhough it has no parameters). I have no issues with a local script that I also use on Linux. My testicle bet keeps on going, mate. Edited April 28, 2017 by Magerange
thechuck Posted April 28, 2017 Posted April 28, 2017 Add me on skype and get me on Teamview, i'll get that beezy workin. Linux is my bread n butter lol. 1
thechuck Posted April 28, 2017 Posted April 28, 2017 Or pm me your bash script -- I dont need to teamview but messaging through this sucks. I'd prefer skype or some other messenger if im going to help 1
Magerange Posted April 28, 2017 Author Posted April 28, 2017 (edited) Thanks @thechuck for trying to help, however it still is messy and doesn't start the script with necessary parameters I'll just post pictures / output what I get when I try to run the code. So the code is: #!/bin/bash java -jar OSBot.jar -login username:password -proxy IP:port:username:password -bot username:password:0000 -script id:param1;param2;param3;param4 -world XYZ Output in terminal: Output in Osbot logger: Edited April 28, 2017 by Magerange