]>
Commit | Line | Data |
---|---|---|
bfd77eaf MT |
1 | #!/bin/bash |
2 | ||
3 | . /etc/sysconfig/rc | |
4 | . ${rc_functions} | |
5 | ||
6 | ||
7 | function init_table() { | |
8 | # Check if table does already exist. If not we add it. | |
9 | if (ip rule | grep -qeE static >/dev/null 2>&1); then | |
10 | return | |
11 | fi | |
12 | ||
13 | ip rule add table static | |
14 | } | |
15 | ||
16 | ||
17 | case "${1}" in | |
18 | start) | |
19 | boot_mesg "Adding static routes..." | |
20 | ||
21 | # First, initialize the table | |
22 | init_table | |
23 | ||
24 | ### ADD ALL ROUTES | |
25 | ||
26 | evaluate_retval | |
27 | ;; | |
28 | ||
29 | stop) | |
30 | boot_mesg "Removing static routes..." | |
31 | ip route flush table static >/dev/null 2>&1 | |
32 | evaluate_retval | |
33 | ;; | |
34 | ||
35 | *) | |
36 | echo "Usage: ${0} {start|stop}" | |
37 | exit 1 | |
38 | ;; | |
39 | esac |