Results 1 to 8 of 8

Thread: Adding "secure_access_group" to "domain_create_post.sh" script

  1. #1
    Join Date
    Feb 2009
    Posts
    142

    Adding "secure_access_group" to "domain_create_post.sh" script

    Hey!

    There is a variable of "secure_access_group" feature to use inside the "domain_create_post.sh" script?

    For example, I have this code:
    Code:
    #!/bin/sh
    WEB_PATH=~${username}/domains/${domain}/public_html
    chown ${username}:${username} $WEB_PATH
    chmod 755 $WEB_PATH
    exit 0;
    So, Instead of:
    Code:
    chown ${username}:${username} $WEB_PATH
    I need to use in something like:
    Code:
    chown ${username}:${secure_access_group} $WEB_PATH
    Thank you!
    Last edited by Scolpy; 08-12-2011 at 12:51 PM.

  2. #2
    Join Date
    Jun 2009
    Posts
    557
    If its a shell script then im sure you can make a variable like

    secure_access_group=$(cat /usr/local/directadmin/conf/directadmin.conf | grep secure_access_group | cut -d= -f2)

  3. #3
    Join Date
    Feb 2009
    Posts
    142
    Quote Originally Posted by mr.applesauce View Post
    If its a shell script then im sure you can make a variable like

    secure_access_group=$(cat /usr/local/directadmin/conf/directadmin.conf | grep secure_access_group | cut -d= -f2)
    Thanks!

    I've created the script with this content:
    Code:
    #!/bin/sh
    secure_access_group=$(cat /usr/local/directadmin/conf/directadmin.conf | grep secure_access_group | cut -d= -f2) 
    WEB_PATH=~${username}/domains/${domain}/public_html
    chown ${username}:${secure_access_group} $WEB_PATH
    chmod 755 $WEB_PATH
    exit 0;
    But after I've created some domain, I saw that it didn't actually changed anything in the ownership and the public_html still USERNAME:USERNAME instead of USERNAME:SECURE_ACCESS_GROUP.

    what I did wrong?
    Last edited by Scolpy; 08-12-2011 at 03:00 PM.

  4. #4
    Join Date
    Jul 2008
    Location
    Maastricht
    Posts
    2,844
    Try using it in the user_create_post.sh because you created a user in the first place.
    I had kindlike problem with domain_create_post.sh and some rights of something else too. Maybe you can maken them in both so that domain does not overwrite things wrongly when creating another domain for the user.
    Greetings, Richard.

  5. #5
    Join Date
    Feb 2009
    Posts
    142
    Quote Originally Posted by Richard G View Post
    Try using it in the user_create_post.sh because you created a user in the first place.
    I had kindlike problem with domain_create_post.sh and some rights of something else too. Maybe you can maken them in both so that domain does not overwrite things wrongly when creating another domain for the user.
    I don't think so because after I've created the domain, I got this message:
    Domain Created

    Details

    Script output: domain_create_post.sh

    Domain Created Successfully
    which mean that just "domain_create_post.sh" script executed after the domain has created.

    P.S.
    I've tried to do so, just in case it will work. but as I thought - it didn't work.

    Thank you anyway for your desire to help

  6. #6
    Hello,

    I'd recommend grabbing the secure_access_group variable from the directadmin binary, in case it's using an internal default.

    eg:
    Code:
    secure_access_group=`/usr/local/directadmin/directadmin c | grep secure_access_group |  cut -d= -f2`
    Also, try generating some debug output to ensure your variables are as exepected, eg:
    Code:
    echo "user: $username" >> /tmp/test.log
    echo "domain: $domain" >> /tmp/test.log
    echo "sag: $secure_access_group" >> /tmp/test.log
    echo "path: $WEB_PATH" >> /tmp/test.log
    As usual, ensure you've set the domain_create_post.sh to 755.
    You should also be able to test it manually (depending on the shell you're using), eg:
    Code:
    cd /usr/local/directadmin/scripts/custom
    user=testuser domain=domain.com ./domain_create_post.sh
    John

  7. #7
    Join Date
    Oct 2004
    Location
    London, UK
    Posts
    6,641
    Ive a question about this.

    I use to set public_html to 710 user:user with mod-ruid2 and /home/user with user:accessgroup 710.

    Is this correct?

    Why set access group to public_html?

    Regards
    SeLLeRoNe - Andrea Iannucci
    DevOps Engineer - System Administrator
    If you need my support write me an E-Mail to Support@CrazyNetwork.it

  8. #8
    Join Date
    Feb 2009
    Posts
    142
    Quote Originally Posted by SeLLeRoNe View Post
    Ive a question about this.

    I use to set public_html to 710 user:user with mod-ruid2 and /home/user with user:accessgroup 710.

    Is this correct?

    Why set access group to public_html?

    Regards
    Yes, you don't need to set the "secure_access_group" to public_html also.

Similar Threads

  1. Replies: 3
    Last Post: 05-04-2012, 08:41 AM
  2. Replies: 0
    Last Post: 09-01-2011, 01:11 AM
  3. FR: Show "account suspended" on login in stead of "failed username/password"
    By DutchTSE in forum Feedback & Feature Requests
    Replies: 3
    Last Post: 10-20-2010, 12:46 PM
  4. server not allowing users to "overuse" or "oversell" resources
    By rszkutak in forum Admin-Level Difficulties
    Replies: 6
    Last Post: 08-13-2007, 09:57 AM
  5. "domain user" - "user" - "reseller" - "admin"
    By mmerlin in forum DirectAdmin General Discussion
    Replies: 1
    Last Post: 10-22-2004, 12:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •