aboutsummaryrefslogtreecommitdiff
path: root/init/init.csh
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@users.noreply.github.com>2021-06-16 12:09:10 -0400
committerGitHub <noreply@github.com>2021-06-16 12:09:10 -0400
commitc1476e3394f875f33834877a63f485ec6a6be8f6 (patch)
tree1f0a93a9857871fbaf3ec9ad10a0ccc8c6f5bca4 /init/init.csh
parentb0688d5619407b9ac44dd238dc66e0b6841279e0 (diff)
downloadmultihome-c1476e3394f875f33834877a63f485ec6a6be8f6.tar.gz
Add shell init scripts and host_groups (#3)
* Add shell init scripts (templates) * Check for additional symbols * Handle missing PATH_MAX declaration (e.g. Ubuntu) * Install shell scripts into $PREFIX/share/init * Replace _INIT declaration with HOST_GROUP * Add scripts_dir and config_host_group struct elements to global 'multihome' * Fix count_substrings() returning wrong type * Refactor RSYNC_BIN to MULTIHOME_RSYNC_BIN * get_timestamp() no longer accepts a buffer as an argument * write_init_script() now uses scripts in $PREFIX/share/init/ to generate output files * Add user_host_group(), which allows grouping systems to a single home directory by way of regex pattern matching * strip_domainname() returns modified pointer, not new storage * Fix strip_domainname test * Create configuration directory if it does not exist * CI needs to install multihome and use the correct script * Always resolve argv[0] to absolute path
Diffstat (limited to 'init/init.csh')
-rw-r--r--init/init.csh12
1 files changed, 12 insertions, 0 deletions
diff --git a/init/init.csh b/init/init.csh
new file mode 100644
index 0000000..5c370c7
--- /dev/null
+++ b/init/init.csh
@@ -0,0 +1,12 @@
+# Set location of multihome to avoid PATH lookups
+setenv MULTIHOME "%s"
+if ( -x "$MULTIHOME" ) then
+ # Save HOME
+ setenv HOME_OLD "$HOME"
+ # Redeclare HOME
+ setenv HOME "`$MULTIHOME`"
+ # Switch to new HOME
+ if ( "$HOME" != "$HOME_OLD" ) then
+ cd "$HOME"
+ endif
+endif