#!/bin/sh PREFIX_DIR=@PREFIXDIR@ SHARES_DB=/var/lib/likewise/db/lwio-shares.db ShowUsage() { echo "\nUsage: lwnet share {add, delete, list} \n" echo " lwnet share add [-c ] [-s ] -i -p name" echo " lwnet share delete name" echo " lwnet share list" } AddShare() { _comment= _sid= _path= _name= _service= while [ $# -gt 0 ]; do case $1 in -c) shift if [ $# -lt 1 ]; then ShowUsage exit 1 fi _comment=$1 shift ;; -i) shift if [ $# -lt 1 ]; then ShowUsage exit 1 fi case $1 in "A:"|"LPT1"|"IPC"|"COMM") _service=$1 ;; *) _service= ;; esac shift ;; -s) shift if [ $# -lt 1 ]; then ShowUsage exit 1 fi _sid=$1 shift ;; -p) shift if [ $# -lt 1 ]; then ShowUsage exit 1 fi _path=$1 shift ;; *) _name=$1 shift ;; esac done if test "x$_name" = "x"; then echo "Please specify a valid share name" ShowUsage exit 1 fi if test "x$_path" = "x"; then echo "Please specify a valid share path" ShowUsage exit 1 fi if test "x$_service" = "x"; then echo "Please specify a valid service name, one of {A:, LPT1:, IPC, COMM}" ShowUsage exit 1 fi $PREFIX_DIR/bin/sqlite3 $SHARES_DB <