I've just added a drive mounted at /home2 for adding more accounts. We use a few hook scripts like user_create_post that currently have '/home' hardcoded, but now need the scripts to pull the home directory dynamically depending on which drive the account is on (/home or /home2). The scripts can use variables from /usr/local/directadmin/data/users/username/user.conf but this doesn't seem to contain the user's home dir.
If I set home_override_list=/home:/home2 in directadmin.conf, and then set /home2 in all packages, when I create a site it does put create_user_home_override=/home2 to user.conf. But if I change the value in the package back to /home (say for adding new sites on /home), it changes the user.conf for any existing accounts on that package to create_user_home_override=/home (which is wrong - they're still at /home2). So that won't work for my purpose.
And if I set create_user_home_override=/home2 and home_override_list= or home_override_list=/home:/home2 in directadmin.conf, and don't set a home dir in any packages, nothing is added to user.conf at all. So again, that won't work.
I can use the hook scripts to check for the existence of /home/username/ or /home2/username/ to see which one exists, then use that in the scripts. But it seems a bit unnecessary and will need error checks etc. Wondering if I'm missing an easier way to get this info - DirectAdmin must store the home path of each user somewhere. But where? Any pointers in the right direction would be appreciated!
If I set home_override_list=/home:/home2 in directadmin.conf, and then set /home2 in all packages, when I create a site it does put create_user_home_override=/home2 to user.conf. But if I change the value in the package back to /home (say for adding new sites on /home), it changes the user.conf for any existing accounts on that package to create_user_home_override=/home (which is wrong - they're still at /home2). So that won't work for my purpose.
And if I set create_user_home_override=/home2 and home_override_list= or home_override_list=/home:/home2 in directadmin.conf, and don't set a home dir in any packages, nothing is added to user.conf at all. So again, that won't work.
I can use the hook scripts to check for the existence of /home/username/ or /home2/username/ to see which one exists, then use that in the scripts. But it seems a bit unnecessary and will need error checks etc. Wondering if I'm missing an easier way to get this info - DirectAdmin must store the home path of each user somewhere. But where? Any pointers in the right direction would be appreciated!