
# camp_sysinfo Installer Scripts

Scripts to configure camp_sysinfo for the current system. The main script, `setup`, calls all of the other scripts, then exits when calling `../configure` to allow interactive configuration of the setup.

No flags are necessary for any of these scripts; by default, they will do an interactive installation (`--quiet` turns that off).

`setup` is a macro script which simply calls the other scripts.

## Usage

### Full Configuration

```sh
./setup   # does full configuration, calling all other scripts
```

#### Options

- `--os`, `-o`      — lower case name of operating system (debian, freebsd, etc...)
- `--dryrun`, `-n`  — do not actually do anything, just tell you what I'd do
- `--version`, `-v` — display version and exit
- `--quiet`, `-q`   — do not ask questions, just do stuff
- `--help`, `-g`    — show this screen
- `--seed`, `-s`    — URL/Path to seed file for config
- `--debug`         — show extra information (`--nodebug` is default)

### Individual Scripts

Following scripts can be run individually, if desired. They are run by `setup`, but can be rerun at any time.

#### validateDependencies

Installs binaries and perl libraries as needed.

```sh
./validateDependencies
```

Options:
- `--os`, `-o`      — lower case name of operating system (debian, freebsd, etc...)
- `--dryrun`, `-n`  — do not actually do anything, just tell you what I'd do
- `--version`, `-v` — display version and exit
- `--quiet`, `-q`   — do not ask questions, just do stuff
- `--debug`         — turn on debug mode (no short form). `--nodebug` turns off (default)
- `--help`, `-h`    — show this screen

#### checkFiles

Creates cron files/entries and a basic configuration file.

```sh
./checkFiles
```

Options:
- `--os`, `-o`      — lower case name of operating system (debian, freebsd, etc...)
- `--dryrun`, `-n`  — do not actually do anything, just tell you what I'd do
- `--version`, `-v` — display version and exit
- `--quiet`, `-q`   — do not ask questions, just do stuff
- `--help`, `-g`    — show this screen
- `--seed`, `-s`    — URL/Path to seed file for config to override default
- `--debug`         — show extra information (`--nodebug` is default)

#### permissions

Sets permissions. Runs each `modules/*` script; if it fails, unsets executable flag so it is not run by sysinfo-client.

```sh
./permissions
```

Options: _none_

> **Note:** Does not correctly set ownership on BSD systems.

#### configure

Validates configuration and allows user to set most parameters.

```sh
../configure
```

Options:
- `--verbose`, `-v`   — verbosity level, 0-9 (may be entered more than once, e.g. `-vvv` to increase verbosity)
- `--file`, `-f`      — file name to read
- `--output`, `-o`    — file to save to
- `--test`, `-t`      — test the config file and report errors
- `--dryrun`, `-n`    — do not save result
- `--quiet`, `-q`     — do not ask any questions, automatically check, repair and write to output
- `--help`, `-h`      — display help screen

---

## server.info

`server.info` is an optional configuration file, typically stored in `/etc/server.info`, that provides basic information about the machine for use by sysinfo and other applications.

### Format

- Colon-separated key-value pairs: `Key: Value`
- Leading/trailing whitespace is ignored.
- Keys are case-insensitive.
- Lines beginning with a pound sign (`#`) or blank lines are ignored.

### Standard Options

- **Owner**    : Name of the owner
- **Location** : Location of the device
- **Name**     : Name of the device (overrides autodetection)
- **UUID**     : UUID of the device (overrides autodetection)
- **Serial**   : Serial number of the device (overrides autodetection)
- **OS_Type**  : Type of operating system
- **Tags**     : Comma-delimited list of tags for the system

You may add other fields as needed; unrecognized fields will be ignored by sysinfo and related tools.
