Adaptec 5325301507 Administration Guide - Page 195
Scripts in SnapCLI, Appendix B, Command Line Interface, Add the user to the group, Create a share
![]() |
UPC - 753253015740
View all Adaptec 5325301507 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 195 highlights
Scripts in SnapCLI Add the user to the group # if both the user and the group exist add the user as a member of this group if $CLI user get user-name="$1" > /dev/null 2>&1; then if $CLI group get group-name="$2" > /dev/null 2>&1; then echo "Adding user '$1' to group '$2' ..." $CLI group member add user-name="$1" group-name="$2" > /dev/null 2>&1 if [ $? -ne 0 ]; then echo "Adding user '$1' to group '$2' failed." return 1 fi fi fi return 0 } # usage: 'mkshare ' mkshare() { # if the share does not exist create it if ! $CLI share get share-name="$1" > /dev/null 2>&1; then echo "Creating share '$1' ..." $CLI share create share-name="$1" share-volume="$2" > /dev/null 2>&1 if [ $? -ne 0 ]; then echo "Creating share '$1' failed." return 1 fi else echo "Share '$1' already exists." fi return 0 } Create a share # usage: 'rmuser ' rmuser() { # if the user exists then delete it if $CLI user get user-name="$1" > /dev/null 2>&1; then echo "Deleting user '$1' ..." $CLI user delete user-name="$1" > /dev/null 2>&1 if [ $? -ne 0 ]; then echo "Deletion of user '$1' failed." return 1 fi else echo "User '$1' does not exist." fi return 0 } Delete the user # usage: 'rmgroup ' rmgroup() { # if the group exists then delete it if $CLI group get group-name="$1" > /dev/null 2>&1; then echo "Deleting group '$1' ..." Delete the group Appendix B Command Line Interface 179
![](/manual_guide/products/adaptec-5325301507-administration-guide-0f96d41/195.png)