shell scripts for administering linux machines
Find a file
2025-02-10 18:55:14 -06:00
bin lol i made a different, very obvious mistake. 2025-02-10 18:55:14 -06:00
env Update README.md and add self-updater 2025-02-09 11:20:53 -06:00
README.md oops i forgot to update the script when i changed the docs 2025-02-10 18:38:59 -06:00
TODO.md oops i forgot to update the script when i changed the docs 2025-02-10 18:38:59 -06:00

these are my shell scripts for making the command line a little easier bc typing is hard

setup

  1. clone this repo
  2. add the following to your .profile or equivalent:
    AS_PATH=/path/to/admin-scripts
    PATH="$AS_PATH/bin:$PATH"
    . "$AS_PATH/env"
    
    and change the value in the first line to the real path.
  3. set any environment variables you want from the table below.

environment variables you can use

name description default
COMPOSE_ROOT path where dc will do its work /opt/compose
S_INIT manually override the init system s assumes ``

scenarios

systemd, openrc

  • s <service_name> <action>
  • action can be one of: edit, logs, off, on, restart, start, status. stop

docker

  • keep multiple separate docker compose files in their own dirs
  • update them all with update-compose
  • dc <stack> <command> works the same as s

update-*

update, upgrade, and collect garbage (depending on the type of service)

  • apt - for debian and its derivatives*.
  • compose - update stacks in $COMPOSE_ROOT
  • caddy* - iterates $CADDY_ROOT's subdirs, pulls git repos, and runs build.sh if it exists. then restarts caddy.

* untested