Debian Codegraph @

scripts/bin/get-necessary-nfsd-no

raw symbols SCIP
1 #!/bin/bash
2 # Author: Steven Shiau <steven _at_ clonezilla org>
3 # License: GPL
4 #
5 # generate the NFS exports or clean the old one.
6
7 # Load DRBL setting and functions
8 DRBL_SCRIPT_PATH="${DRBL_SCRIPT_PATH:-/usr/share/drbl}"
9
10 . $DRBL_SCRIPT_PATH/sbin/drbl-conf-functions
11
12 # calculate the number of the NFS daemon
13 total_client_no="$(get-client-ip-list | wc -l)"
14 [ -z "$total_client_no" ] && exit 1
15 nfsd_no="$(echo "scale=0; $NFSD_RATIO * $total_client_no / 1" | bc -l)"
16 [ "$nfsd_no" -ge $NFSD_MAX ] && nfsd_no=$NFSD_MAX
17
18 echo "$nfsd_no"