Adaptec 5325301507 Administration Guide - Page 194
Sample Script, Following is an example script that can be used to create and remove users, groups
![]() |
UPC - 753253015740
View all Adaptec 5325301507 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 194 highlights
Scripts in SnapCLI Sample Script Following is an example script that can be used to create and remove users, groups, and shares: #!/bin/sh # Copyright 2003-2007 Overland Storage, Inc. All rights reserved. # # Permision is granted to use this code provided that it # # retains the above copyright notice. ## CLI=/bin/cli USER=myuser PASSWORD=myuserpass GROUP=mygroup SHARE=myshare VOLUME=VOL0 # usage: 'mkuser ' mkuser() { # if the user does not exist then create it if ! $CLI user get user-name="$1" > /dev/null 2>&1; then echo "Creating user '$1' ..." $CLI user create user-name="$1" password="$2" > /dev/null 2>&1 if [ $? -ne 0 ]; then echo "Creation of user '$1' failed." return 1 fi else echo "User '$1' already exists." fi return 0 } # usage: 'mgroup ' mkgroup() { # if the group does not exist then create it if ! $CLI group get group-name="$1" > /dev/null 2>&1; then echo "Creating group '$1' ..." $CLI group create group-name="$1" > /dev/null 2>&1 if [ $? -ne 0 ]; then echo "Creation of group '$1' failed." return 1 fi else echo "Group '$1' already exists." fi return 0 } # usage: 'adduser2group ' adduser2group() { Create a user Create a group 178 SnapServer Administrator Guide
![](/manual_guide/products/adaptec-5325301507-administration-guide-0f96d41/194.png)