Admin Scripts
What are admin scripts?
NOTE
- Run as admin: You need to be admin user to run the script.
- Basic Usage: To run a script, use the following format:
tl-group-commandparameters (e.g.,tl-hw-prepare /dev/sdb tl-2054) - HELP: Run the command without any arguments to print a quick usage.
- Environment Variables: Customize behavior with environment variables like:
WIFI_NAME='My Network' tl-hw-prepare /dev/sda tl-2054
Script format
How are scripts named?
The scripts follow a naming convention to make them easy to identify and use
- All admin scripts follow a consistent format:
tl-*-*. - Each script begins with the prefix
tl-. - The second part represents the group of commands it belongs
to (e.g.,
hw,img,comp,sys, orusb). - Finally, the third part specifies the specific action or command
within that group (e.g.,
prepare,update, etc.).
Groups of commands
What are the command groups?
[ tl-hw-* ]
Hardware related commands
Hardware related commands (partitioning, installing components, updating bootloaders).
-
tl-hw-prepare: Creates partitions and installs components for TechLit system. -
Takes hard drive and tag as parameters.
-
Example
tl-hw-prepare /dev/sdX tl-2054 -
tl-hw-update-desktop: Unpacks Techlit system archive with the version provided into already-provisioned desktop system on/dev/sdX- Takes hard drive and version(optional) as parameters. example
tl-hw-update-desktop /dev/sdX
- Takes hard drive and version(optional) as parameters. example
-
tl-hw-update-bootloader: Installs and configures bootloaders for the on/dev/sdx -
tl-hw-chroot-desktop: Mounts required partitions and chroots into TechLit system on/dev/sdx
[ tl-img-* ]
Desktop image management
Desktop image management (creating snapshots, packing/unpacking, restoring).
tl-img-save: Creates a new snapshot of the TechLit system hosted at/var/btrfs/snapshots.tl-img-pack: Creates a new clone-able archive of the TechLit system hosted.tl-img-unpack: Unpacks/Extracts a desktop archive into the TechLit system.tl-img-restore: Restores a desktop snapshot of the TechLit system.
[ tl-comp-* ]
Component management
Component management (pulling, pushing, and syncing components).
- All the components are hosted in
/srv/$component - Components include (but not limited to)
desktop,admin,curriculum,helpcontrol
tl-comp-pull: Downloads a version of component fromremotetl-comp-push: Uploads a version of component from/srv/component/toremotetl-comp-sync: Updates list of local and remote versions for component. (This script is called by the other 2 scripts in this group)
[ tl-sys-* ]
System configuration
System configuration (network setup, Driver personalization etc).
tl-sys-configure: Reconfigures Techlit system with a new configuration file.- The options include:
role,hostname,wifi_name, andwifi_password - The config file is located here
/srv/secure/config.json
- The options include:
tl-sys-personalize: Personalizes the system using the values in theconfig.jsontl-sys-anonymize: Removes sensitive data from a Techlit system and custom configuration.
[ tl-usb-* ]
USB drive tasks
USB drive tasks (creating installer USBs, updating components).
tl-usb-prepare: Creates and installs components a TechLit installer USB on/dev/sdx.tl-usb-update-components: Copies updated Techlit components on the USB.tl-usb-update-recovery: Updates iso partition with a new recovery iso.tl-usb-update-bootloader: Install/Update and configure bootloaders for the USB.
Examples
See command examples
Some examples of some common command usage
Install
- A Techlit system for the first time on a computer
with a hard drive
/dev/sdaand tagtl-2054
tl-hw-prepare /dev/sda tl-2054- With environment variables
WIFI_NAME="TechLit Vim" tl-hw-prepare /dev/sda tl-2054Update
- A Techlit system from a desktop image hosted in
/dev/sda
tl-hw-update-desktop /dev/sdaReconfigure
- A TechLit system first time after preparing
tl-sys-configureFix Bootloader
- On a TechLit Computer unable to boot because of bootloader or wrong fstab by
reinstalling Grub bootloader on a TechLit system installed at
/dev/sda
sudo tl-hw-update-bootloader /dev/sda