mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 10:35:53 +02:00
add loxilb start/stop init script and settings
when rebuid the image, do: rm log/configroot rm log/initscripts Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
This commit is contained in:
1
config/cfgroot/loxilb-settings
Normal file
1
config/cfgroot/loxilb-settings
Normal file
@@ -0,0 +1 @@
|
||||
ENABLE_LOXILB=off
|
||||
@@ -200,3 +200,4 @@ var/ipfire/wireless
|
||||
#var/ipfire/wireless/config
|
||||
#var/ipfire/wireless/settings
|
||||
var/ipfire/ddos
|
||||
var/ipfire/loxilb
|
||||
|
||||
@@ -92,6 +92,7 @@ etc/rc.d/init.d/vnstat
|
||||
etc/rc.d/init.d/waitdrives
|
||||
etc/rc.d/init.d/wlanclient
|
||||
etc/rc.d/init.d/ddos
|
||||
etc/rc.d/init.d/loxilb
|
||||
#etc/rc.d/rc0.d
|
||||
#etc/rc.d/rc0.d/K01imspetor
|
||||
#etc/rc.d/rc0.d/K01motion
|
||||
|
||||
@@ -54,7 +54,7 @@ $(TARGET) :
|
||||
ethernet extrahd/bin fwlogs fwhosts firewall ipblocklist key langs logging mac main \
|
||||
menu.d modem optionsfw \
|
||||
ovpn patches pakfire portfw ppp private proxy/advanced/cre \
|
||||
proxy/calamaris/bin qos/bin red remote ddos sensors suricata time \
|
||||
proxy/calamaris/bin qos/bin red remote ddos loxilb sensors suricata time \
|
||||
updatexlrator/bin updatexlrator/autocheck urlfilter/autoupdate urlfilter/bin vpn \
|
||||
wakeonlan wireless ; do \
|
||||
mkdir -p $(CONFIG_ROOT)/$$i; \
|
||||
@@ -68,7 +68,7 @@ $(TARGET) :
|
||||
fwhosts/customnetworks fwhosts/customhosts fwhosts/customgroups fwhosts/customservicegrp fwhosts/customlocationgrp fwlogs/ipsettings fwlogs/portsettings ipblocklist/modified \
|
||||
ipblocklist/settings mac/settings main/hosts main/routing main/security main/settings optionsfw/settings \
|
||||
ovpn/ccd.conf ovpn/ccdroute ovpn/ccdroute2 pakfire/settings portfw/config ppp/settings-1 ppp/settings-2 ppp/settings-3 ppp/settings-4 \
|
||||
ppp/settings-5 ppp/settings proxy/settings proxy/squid.conf proxy/advanced/settings proxy/advanced/cre/enable remote/settings ddos/settings ddos/tcp_ports ddos/udp-ddos-settings ddos/udp_ports ddos/dns-ddos-settings qos/settings qos/classes qos/subclasses qos/level7config qos/portconfig \
|
||||
ppp/settings-5 ppp/settings proxy/settings proxy/squid.conf proxy/advanced/settings proxy/advanced/cre/enable remote/settings ddos/settings ddos/tcp_ports ddos/udp-ddos-settings ddos/udp_ports ddos/dns-ddos-settings loxilb/settings qos/settings qos/classes qos/subclasses qos/level7config qos/portconfig \
|
||||
qos/tosconfig suricata/settings vpn/config vpn/settings vpn/ipsec.conf \
|
||||
vpn/ipsec.secrets vpn/caconfig wakeonlan/clients.conf wireless/config wireless/settings; do \
|
||||
touch $(CONFIG_ROOT)/$$i; \
|
||||
@@ -103,6 +103,7 @@ $(TARGET) :
|
||||
cp $(DIR_SRC)/config/cfgroot/udp-ddos-settings $(CONFIG_ROOT)/ddos/udp-ddos-settings
|
||||
cp $(DIR_SRC)/config/cfgroot/udp_ports $(CONFIG_ROOT)/ddos/udp_ports
|
||||
cp $(DIR_SRC)/config/cfgroot/dns-ddos-settings $(CONFIG_ROOT)/ddos/dns-ddos-settings
|
||||
cp $(DIR_SRC)/config/cfgroot/loxilb-settings $(CONFIG_ROOT)/loxilb/settings
|
||||
cp $(DIR_SRC)/config/cfgroot/time-settings $(CONFIG_ROOT)/time/settings
|
||||
cp $(DIR_SRC)/config/cfgroot/logging-settings $(CONFIG_ROOT)/logging/settings
|
||||
cp $(DIR_SRC)/config/cfgroot/ethernet-vlans $(CONFIG_ROOT)/ethernet/vlans
|
||||
|
||||
@@ -68,7 +68,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
||||
done
|
||||
chown -R root:root /srv/web/ipfire
|
||||
chmod -R 755 /srv/web/ipfire/cgi-bin
|
||||
chmod -R 644 /srv/web/ipfire/html
|
||||
#chmod -R 644 /srv/web/ipfire/html
|
||||
chmod 755 /srv/web/ipfire/html /srv/web/ipfire/html/{index.cgi,redirect.cgi,images,include,themes,themes/*,themes/*/*}
|
||||
|
||||
# Reset permissions of redirect templates and theme directories
|
||||
|
||||
61
src/initscripts/system/loxilb
Executable file
61
src/initscripts/system/loxilb
Executable file
@@ -0,0 +1,61 @@
|
||||
#!/bin/sh
|
||||
###############################################################################
|
||||
# #
|
||||
# IPFire.org - A linux based firewall #
|
||||
# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
|
||||
# Copyright (C) 2024 BPFire <vincent.mc.li@gmail.com> #
|
||||
# #
|
||||
# This program is free software: you can redistribute it and/or modify #
|
||||
# it under the terms of the GNU General Public License as published by #
|
||||
# the Free Software Foundation, either version 3 of the License, or #
|
||||
# (at your option) any later version. #
|
||||
# #
|
||||
# This program is distributed in the hope that it will be useful, #
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
|
||||
# GNU General Public License for more details. #
|
||||
# #
|
||||
# You should have received a copy of the GNU General Public License #
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
|
||||
# #
|
||||
###############################################################################
|
||||
|
||||
. /etc/sysconfig/rc
|
||||
. $rc_functions
|
||||
|
||||
eval $(/usr/local/bin/readhash /var/ipfire/loxilb/settings)
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
boot_mesg -n "Starting loxilb..."
|
||||
if [ "$ENABLE_LOXILB" == "on" ]; then
|
||||
if [ -d /opt/loxilb/dp/ ]; then
|
||||
umount /opt/loxilb/dp/
|
||||
rm -fr /opt/loxilb/dp/bpf
|
||||
fi
|
||||
|
||||
mkdir -p /opt/loxilb/dp/
|
||||
mount -t bpf bpf /opt/loxilb/dp/
|
||||
|
||||
loadproc -b loxilb
|
||||
fi
|
||||
;;
|
||||
|
||||
stop)
|
||||
boot_mesg "Stopping loxilb..."
|
||||
if [ "$ENABLE_LOXILB" == "off" ]; then
|
||||
killproc loxilb
|
||||
fi
|
||||
;;
|
||||
|
||||
restart)
|
||||
$0 stop
|
||||
sleep 1
|
||||
$0 start
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user