forked from sonoble/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathnps-modules-4.9-amd64
More file actions
executable file
·54 lines (42 loc) · 1.07 KB
/
nps-modules-4.9-amd64
File metadata and controls
executable file
·54 lines (42 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
# This script load/unload nps kernel modules
### BEGIN INIT INFO
# Provides: load-nps-modules
# Required-Start:
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start: S
# Default-Stop: 0 6
# Short-Description: Load nps kernel modules
### END INIT INFO
case "$1" in
start)
echo -n "Load nps kernel modules... "
RMEM_SIZE=`cat /proc/sys/net/core/rmem_max`
if [ $RMEM_SIZE -lt 8388608 ]; then
echo "8388608" > /proc/sys/net/core/rmem_max
fi
WMEM_SIZE=`cat /proc/sys/net/core/wmem_max`
if [ $WMEM_SIZE -lt 25165824 ]; then
echo "25165824" > /proc/sys/net/core/wmem_max
fi
modprobe nps_dev
modprobe nps_netif
echo "done."
;;
stop)
echo -n "Unload nps kernel modules... "
rmmod nps_netif
rmmod nps_dev
echo "done."
;;
force-reload|restart)
echo "Not supported"
;;
*)
echo "Usage: /etc/init.d/nps-modules-4.9.0-14-2-amd64.init {start|stop}"
exit 1
;;
esac
exit 0