Scripts in SnapCLI
156 Snap Server Administrator Guide
$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
}
# usage: 'rmuser <user_name>'
rmuser()
{
Delete the user
# 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
}
# 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
Summary of Contents for 5325301656 - Snap Server 14000 NAS
Page 2: ......
Page 76: ...Disks and Units 62 Snap Server Administrator Guide ...
Page 92: ...Creating iSCSI Disks 78 Snap Server Administrator Guide ...
Page 108: ...Security Guides 94 Snap Server Administrator Guide ...
Page 144: ...Unicode and Expansion Arrays 130 Snap Server Administrator Guide ...
Page 164: ...Off the Shelf Backup Solutions for the Snap Server 150 Snap Server Administrator Guide ...
Page 172: ...Scripts in SnapCLI 158 Snap Server Administrator Guide ...