Example of custom script
#!/bin/sh
#script checks if service with the same name or vid already exists
#if not creates a new entry in VTU with given VID
#
#
input parameters:
#
service_name - name of the new service
#
VID - vid of the new service
#
#
return values:
#
0 - ok
#
3 - bad parameter
#
5 - service already exists
#
6 - there already exists an entry with given VID
#
42 - other error
D42_NAME="$1"
D42_VID="$2"
D42N="service_data42"
error()
{
echo "$D42N: Error: $*" >&2
}
info()
{
echo "$D42N: $*" >&2
}
die()
{
error "$*"
exit 42 #error
}
# basic check if not empty
if [ -z "$D42_NAME" ]; then
error "Bad service name"
exit 3
fi
if [ -z "$D42_VID" ]; then
error "Bad service VID"
exit 3
fi
D42_FOUND=$(cli_nw_get --vtu all | grep "$D42_NAME")
if [ -n "$D42_FOUND" ]; then
error "Service(s) with name $D42_NAME found"
echo $D42_FOUND
exit 5
171
© RACOM s.r.o. – RAy3 Microwave Link
Configuration
Содержание RAy3-11
Страница 2: ......