10400455-002
©2008-14 Overland Storage, Inc.
275
SnapScale/RAINcloudOS 4.1 Administrator’s Guide
E - Command Line Interface
if [ $? -ne 0 ]; then
echo "Deletion of user '$1' failed."
return 1
fi
else
echo "User '$1' does not exist."
fi
return 0
}
# usage: 'rmgroup <group_name>'
rmgroup()
{
Delete the Group
# if the group exists then delete it
if $CLI group get group-name="$1" > /dev/null 2>&1; then
echo "Deleting group '$1' ..."
$CLI group delete group-name="$1" > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Deletion of group '$1' failed."
return 1
fi
else
echo "Group '$1P' does not exist."
fi
return 0
}
# usage: 'rmshare <share_name>'
rmshare()
{
Delete the Share
# if the share exists delete it
if $CLI share get share-name="$1" > /dev/null 2>&1; then
echo "Deleting share '$1' ..."
$CLI share delete share-name="$1" > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Deletion of share '$1' failed."
return 1
fi
else
echo "Share '$1' does not exist."
fi
return 0
}
Create a User, Group, and Share; Then Add the User to the Group
##############
# Main #
##############
# create a user, a group and a share and add the user to the group
mkuser "$USER" "$PASSWORD"
mkgroup "$GROUP"
adduser2group "$USER" "$GROUP"
mkshare "$SHARE" "$VOLUME"
#remove the group, the user and the share
rmgroup "$GROUP"
rmuser "$USER"
rmshare "$SHARE"