Skip to content

cloux/sin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Installer

About

Simple INstaller provides a common interface for running multiple scripts in series, aimed to automate the installation and updates of applications outside of the main software repositories. Easily customizable and extendable using modular file structure. Poses no restrictions on the programming language, installation methods or required privileges for used commands. It is aimed at GNU/Linux, but it should run on any OS with a shell like FreeBSD or MacOS.

Structure

Simple Installer works with modules and commands. Modules are directories in the installer module path, and commands are executable scripts within these directories. SIN searches for modules/commands in:

  1. ~/.local/share/sin/module/command
  2. /usr/local/share/sin/module/command
  3. /usr/share/sin/module/command
  4. in the sin script path inside modules subdirectory

Module paths are searched in this order. If there is more than one module with the same name, the first found module/command is the one that will be executed.

Command Scripts

All command scripts should:

  • have executable bit set
  • be able to run unattended and never require user input
  • never use parameters, use config files if required
  • be able to run as standalone outside of sin
  • have log-friendly output and don't use color codes or other terminal sequences
  • return 0 on success and non-zero on failure

Every module should have at least one command script named install. This command should be able to install and optionally update software if already installed.

Cache

Some SIN command scripts might use system directories to track installations and version updates:

  • /var/cache/sin/
  • /usr/src/
  • /opt/

Logfiles

If run as root, command output is logged into /var/log/sin/COMMAND.log. Existing logfiles are overwritten, no log rotation is necessary. If run as local user, terminal output is not logged to a file. If required, you might run sin MODULE | tee LOGFILE to save the output to a LOGFILE.


Installation

To install SIN with the base modules, run:

git clone https://github.com/cloux/sin
sudo sin/sin sin

After the installation, you can remove the local repository by running rm -rf sin. Note that SIN can be used without installation, see Usage witout installation.

To update an existing installation, run:

sin sin

To uninstall SIN and all its base modules, run:

sin remove sin

Usage

Syntax

sin [COMMAND] MODULE

A single parameter is expected to be a module name. The default command is install.

sin COMMAND MODULE MODULE ...

For two or more parameters, the first parameter is command followed by a list of modules for which the command is executed.

Without installation

You can download and run SIN locally without installation. To install and run SIN locally:

git clone https://github.com/cloux/sin
sin/sin COMMAND MODULE

Also, every script for every module can be downloaded and run separately as a standalone program. To download and use a single module installer without SIN, e.g. to install/update wireguard:

wget https://raw.githubusercontent.com/cloux/sin/master/modules/wireguard/install
chmod 755 install
./install

For a list of available modules and scripts see modules.

Examples

  • sin gitahead
    A single parameter is assumed to be a module name with install command => install/update GitAhead
  • sin install kernel wireguard
    Install/update Linux kernel and wireguard tunnel
  • sin check kernel
    Check if a new Linux kernel is available on kernel.org

License

This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See http://www.wtfpl.net for more details. If you feel that releasing this work under WTFPL is not appropriate, just do WTF you want to. If you feel that using some of this code might be violating some other license, don't use the code (see Disclaimer).


Author

This repository is maintained by cloux@rote.ch

Disclaimer

I do not claim fitness of this project for any particular purpose and do not take any responsibility for its use. You should always choose your system and all of its components very carefully, if something breaks it's on you. See license.

Contributing

I will keep this project alive as long as I can. This is however a private project, so my support is fairly limited. Any help with further development, testing, and bugfixing will be appreciated. If you want to report a bug, please either raise an issue, or fork the project and send me a pull request.


About

Simple Installer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages