+function create_all_routes() {
+ local file=${1}
+ shift
+
+ # Remote all routes.
+ ip route flush table static >/dev/null 2>&1
+
+ local status
+ local network
+ local gateway
+ local remark
+
+ # Read all routes from the configuration file and add the enabled ones
+ # immediately.
+ while IFS=, read status network gateway remark; do
+ [ "${status}" = "on" ] || continue
+
+ if [ -z "${network}" -o -z "${gateway}" ]; then
+ # Silently skipping invalid routes.
+ continue
+ fi
+
+ ip route add ${network} via ${gateway} table static
+ done < ${file}
+}
+
+CONFIGFILE="/var/ipfire/main/routing"