Add git, neofetch, replace iptables with nftables, setup /etc/sysctl.conf
This commit is contained in:
parent
a43e95b17f
commit
8202f22735
5 changed files with 133 additions and 18 deletions
49
board/mentalnet/overlay/etc/init.d/S35nftables
Executable file
49
board/mentalnet/overlay/etc/init.d/S35nftables
Executable file
|
|
@ -0,0 +1,49 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Load the nftables firewall ruleset from /etc/nftables.conf.
|
||||
|
||||
DAEMON="nft"
|
||||
CONF="/etc/nftables.conf"
|
||||
|
||||
start() {
|
||||
printf 'Loading nftables firewall: '
|
||||
if ! [ -f "$CONF" ]; then
|
||||
echo "MISSING $CONF"
|
||||
return 1
|
||||
fi
|
||||
"$DAEMON" -f "$CONF"
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf 'Flushing nftables ruleset: '
|
||||
"$DAEMON" flush ruleset
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart)
|
||||
"$1";;
|
||||
reload)
|
||||
restart;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|reload}"
|
||||
exit 1
|
||||
esac
|
||||
Loading…
Add table
Add a link
Reference in a new issue