IT/Device Setup

From msgwiki
< IT
Revision as of 11:37, 9 May 2024 by Itvte (talk | contribs) (Create systemsetup.sh documentation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This is instructions on how to use the systemsetup.sh script at the cnx school to easily configure new Kubuntu installs.

Usage

The systemsetup script is intended to be run on freshly installed Kubuntu instance, with the timezone and locales set to US. It will work on any system but will do all the important steps for an MSG device after a fresh install.

The script is stored in msgcnxFiles/It/scripts/systemsetup.sh and symlinked to /var/www/html/msgcnx/it/systemsetup.sh to make it easy to get to from a new device.

To use the script, go to https://msgcnx.com/it/systemsetup.sh and follow the instructions listed there.

wget https://msgcnx.com/it/systemsetup.sh && bash systemsetup.sh -h

The script has several options. Use -h to see them all. In general, to setup a new device, run the script using options to indicate what kind of device it is. Here are the most important ones

  • -d: desktop
  • -z: zerotier
  • -s: student

What it does

Here's a list (as of May 2024) of what the script does to the computer:

  1. Installs a list of packages (and relevant ppas)
    1. thunderbird vlc libreoffice nfs-common vim gscan2pdf wget curl shutter simplescreenrecorder filezilla
  2. Installs Chrome and Zoom from downloaded deb files
  3. Sets up a crontab script to keep zoom updated
  4. Changes timezone to Asia/Bangkok
  5. Sets up all regular keyboard Meta+_ shortcuts
  6. Sets up the Meta+X shortcut
  7. Creates an fstab entry to mount msgcnxFiles (slightly differently if it's a student device)
  8. If it's a student device, create a student user account with student password
  9. If it's a desktop, creates a shutdown crontab for 7PM
  10. If zerotier option, install zerotier and add to the msgedu network
  11. Setup a crontab to update packages and rerun the systemsetup script every boot

The script does nothing if it has not been updated since its last run on the device. Use -f or --force to run anyway.

Updating the script

To make changes to the script, just edit the msgcnxFiles/It/scripts/systemsetup.sh file. Make sure to increment the version number at the top of the file and comment what was changed. The changes will trickle down to each device that uses the script when they boot. If you add additional steps to the script, make sure to write things in such a way that if the same code is run again changes to the system will only be made once. For example, when adding a shutdown crontab, check if there is already a shutdown crontab so the same entry is not added multiple times.