switchconf(8)

πŸ’– switchconf(8) β€” System Manager's Manual πŸ’–

okay bestie, listen up, this is switchconf from the System Manager's Manual, and it's genuinely one of those tiny tools that just works. iykyk. πŸ¦‹


✨ NAME ✨

switchconf β€” Change system configuration to one of many predefined


🌸 SYNOPSIS 🌸

switchconf [ -f conf_file ] -help | -list | config_scheme

πŸŽ€ DESCRIPTION πŸŽ€

so switchconf is a command line tool that helps nomad laptop users easily change their configuration. that's it. that's the vibe. you're a laptop girlie who moves between networks and setups, and this is your bestie that swaps your whole config for you. no cap. πŸ’…


✨ OPTIONS ✨

switchconf takes only one mandatory argument. just one. one (1). here's what it can be:

  • if that argument is -help β€” the command synopsis gets output. that's it, that's the whole job. πŸ™ˆ
  • if it's -list β€” you get a list of all known configuration schemes returned for the current set (found in $conf_top_dirs). shopping menu energy. πŸ›οΈ
  • if the argument is a configuration scheme β€” that configuration will be installed on the laptop. slay. πŸ”₯

and then there's the optional one, which must come first:

  • -f β€” flags an optional argument that specifies the set of configuration schemes to work with. it names a configuration file, with the format described below, located on the current directory. if you don't pass it, the default file /etc/switchconf/conf is used. defaults are iconic honestly. πŸ’œ

🧚 CONFIGURATION FILE 🧚

the configuration file (default /etc/switchconf/conf) is simple. literally. here are the entries that are defined:

  • conf_top_dirs β€” this specifies where the configuration schemes are located.
  • dest_dir β€” this specifies which top directory you want to install the new configuration into. this one is pretty useful if you want to debug your configuration without overwriting the actual one. safety first bestie 🫢
  • exec_dir_before, exec_dir_after β€” this specifies the name of the exec directory: all files included in it will be executed before or after configuration changes. order matters, we love a sequence. ✨
  • run_parts β€” this specifies the path to the run-parts command, which is used to execute the scripts. leave it empty to use the internal implementation of run-parts. your choice, main character. πŸ‘‘
  • config_method β€” this specifies the method used to copy the configuration files to their places: softlink, hardlink, copy. three options, all valid, pick your fighter. πŸ’…
⚠️ ok important one: /etc/switchconf/conf should be written so it is parsable as a shell script β€” there should be no spaces between the variable name and its value. no spaces. zero. don't do it. i'm begging. 😭

πŸ¦‹ SCHEMES πŸ¦‹

you should create a directory for each configuration scheme you define, including all the files it should set in the system. inside /etc/switchconf, in the directories, you should create the files including the full path β€” i.e., /etc/switchconf/home/etc/network/interfaces for /etc/network/interfaces. so extra but it makes sense, trust. 🌈

🚨 no scheme should be named as either the exec_dir_before or the exec_dir_after, unless the conf_top_dirs is moved out of its default directory, /etc/switchconf. name collision = chaos. don't.

and even though it's not really necessary, you should probably ensure that all the files existing in one of the schemes exist on every other scheme, in order to ensure you do not end up in a hybrid state. hybrid state is giving cursed. πŸ’€ keep your schemes consistent bestie.


πŸ“ FILES πŸ“

  • /etc/switchconf/conf β€” Configuration file.
  • /var/lib/misc/switchconf.lastcfg β€” Memory file, has the name of the current active scheme. she remembers. 🧠✨
  • /var/lock/switchconf β€” Lock file.

πŸ’€ BUGS πŸ’€

actually no bugs are reported. not one. we're clean. we're flawless. periodt. πŸ’…βœ¨


🌸 AUTHOR 🌸

  • switchconf was written by Sebastien J. Gross <seb@sjgross.org>
  • switchconf was contributed by Julien Ducros <jul@chezwam.org>
  • switchconf was maintained by Jose Calhariz <jose.calhariz@tagus.ist.utl.pt>

and that's the whole page bestie!! πŸŽ€ this was 3rd Berkeley Distribution, dated February 2014 β€” yeah she's a vintage icon, and she still ate. mwah. 😘🫢 go switch some confs. slay. πŸ’–