diff options
author | Joseph Hunkeler <jhunkeler@users.noreply.github.com> | 2021-06-16 12:09:10 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-16 12:09:10 -0400 |
commit | c1476e3394f875f33834877a63f485ec6a6be8f6 (patch) | |
tree | 1f0a93a9857871fbaf3ec9ad10a0ccc8c6f5bca4 /multihome.h | |
parent | b0688d5619407b9ac44dd238dc66e0b6841279e0 (diff) | |
download | multihome-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 'multihome.h')
-rw-r--r-- | multihome.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/multihome.h b/multihome.h index 80ce082..8f4c276 100644 --- a/multihome.h +++ b/multihome.h @@ -19,6 +19,8 @@ #include <wait.h> #include <argp.h> #include <time.h> +#include <dirent.h> +#include <regex.h> #include "config.h" #define VERSION "0.0.1" @@ -26,7 +28,7 @@ #define MULTIHOME_TOPDIR "topdir" #define MULTIHOME_CFGDIR ".multihome" #define MULTIHOME_CFG_TRANSFER "transfer" -#define MULTIHOME_CFG_INIT "init" +#define MULTIHOME_CFG_HOST_GROUP "host_group" #define MULTIHOME_CFG_SKEL "skel/" // NOTE: Trailing slash is required #define MULTIHOME_MARKER ".multihome_controlled" #define OS_SKEL_DIR "/etc/skel/" // NOTE: Trailing slash is required @@ -46,7 +48,7 @@ int shell(char *args[]); int mkdirs(char *path); int copy(char *source, char *dest, int mode); int touch(char *filename); -char *get_timestamp(char **result); +char *get_timestamp(); void write_init_script(); void user_transfer(int copy_mode); char *strip_domainname(char *hostname); |