Help for making a simple script

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
BryanRMelo
Level 1
Level 1
Posts: 1
Joined: Sat Jun 23, 2018 6:29 pm

Help for making a simple script

Post by BryanRMelo »

So, I need to make a script that can be run in my local school server, but I doesn’t make any idea of how to actually do this. English is not my primary language, sorry.
I need to run the following command

sudo apt-get install msttcorefonts

and I didn’t found a way to just throw that in the server and anyone can copy and paste to the machines and easily install, without the need for I manually install in each of the 40 machines.
Is there any kind of .bat or .cmd on mint world?

Hoser Rob
Level 16
Level 16
Posts: 6139
Joined: Sat Dec 15, 2012 8:57 am

Re: Help for making a simples script

Post by Hoser Rob »

Either you install them all or you give the sudo password to a lot of people who shouldn't probably have it for basic security reasons. Your choice.

User avatar
Flemur
Level 18
Level 18
Posts: 8392
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Help for making a simples script

Post by Flemur »

BryanRMelo wrote:
Sat Jun 23, 2018 6:37 pm
I need to run the following command
sudo apt-get install msttcorefonts
...
Is there any kind of .bat or .cmd on mint world?
Yes, and they're far better than the MS attempts. Put that line (sudo apt-get install msttcorefonts) in a file, save the file and make it executable, and there's your script (and put in your $PATH). Name it just about anything you want.

However! The person running it will still need to have admin/root access and know what that script is called. It might be just as easy to have someone enter the command itself.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?

Mute Ant
Level 14
Level 14
Posts: 5132
Joined: Tue Sep 03, 2013 7:45 pm
Location: Norfolk UK

Re: Help for making a simples script

Post by Mute Ant »

Running the command...
sudo apt-get install ttf-mscorefonts-installer
...will get you to a screen that requires you to accept a EULA before the fonts can become part of the OS. I don't think a script can do that for you. Each installation needs to run that command and have the license terms accepted. Messy, but that's the way Microsoft want it. The fonts are not freely available in the FLOSS sense.
While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named "manual".

User avatar
Pilosopong Tasyo
Level 6
Level 6
Posts: 1435
Joined: Mon Jun 22, 2009 3:26 am
Location: Philippines

Re: Help for making a simple script

Post by Pilosopong Tasyo »

BryanRMelo wrote:
Sat Jun 23, 2018 6:37 pm
...
The simplest way is copy over the fonts once they're installed on the server. The fonts are in the /usr/share/fonts/truetype/msttcorefonts directory. Copy them over via sneakernet to the local user's $HOME/.fonts directory (which has to be created first, of course), then fc-cache -fv to force-update the font cache.

Note the above is just *one* of several approaches in doing this and it has its own set of caveats (including the EULA thing and all that), but it's the simplest and practical way I can think of without having to go through the sudo route and the "issues" that comes with it, as others have pointed out. Another one involves using secure shell and it's possible to do this from the central server and propagate the changes to all the clients *after "some" prepwork* has been done.
o Give a man a fish and he will eat for a day. Teach him how to fish and he will eat for a lifetime!
o If an issue has been fixed, please edit your first post and add the word [SOLVED].

User avatar
BG405
Level 8
Level 8
Posts: 2199
Joined: Fri Mar 11, 2016 3:09 pm
Location: England

Re: Help for making a simple script

Post by BG405 »

Pilosopong Tasyo wrote:
Thu Jun 28, 2018 7:35 pm
Another one involves using secure shell and it's possible to do this from the central server and propagate the changes to all the clients *after "some" prepwork* has been done.
This is exactly what I was going to suggest, as it'll save a LOT of leg work. You will need to install openssh-server on the client machines first but this will save you a lot of time later. Simply login from the central server & copy and paste the necessary commands, or use scp, depending on your approach, without having to re-type anything except the password.
Dell Inspiron 1525 - LM17.3 CE 64-------------------Lenovo T440 8GB - Manjaro KDE with Mint VMs
Toshiba NB250 - Manjaro KDE------------------------K7S5A AMD 1.2GHz - LM17.3 Xfce 32 & WinXP-Pro
Acer Aspire E11 ES1-111M - LM18.2 KDE 64 ----Two ROMS don't make a WRITE ...

Post Reply

Return to “Newbie Questions”