Bash "read" only the first line from the file

etc\init.d\zapret

#!/bin/sh /etc/rc.common
START=21
USE_PROCD=1
ROUTE_TABLE_NUM=100
DAEMON_DIR=/usr/sbin/nfq/nfqws
read DAEMON_OPT <etc/firewall.user
start_service() {
	get_daemon
	[ -n "$DAEMON_DIR" ] && {
	    procd_open_instance
	    procd_set_param command $DAEMON_DIR $DAEMON_OPT
	    procd_close_instance
	}
}

etc\firewall.user

# --qnum=200 --user=daemon --dpi-desync=fake,split --dpi-desync-ttl=6 --dpi-desync-fooling=badseq

iptables -t mangle -I POSTROUTING -o wlan0 -p tcp -m multiport --dports 80,443 -m connbytes --connbytes 1:4 --connbytes-mode packets --connbytes-dir original -m mark ! --mark 0x40000000/0x40000000 -j NFQUEUE --queue-num 200 --queue-bypass

How can I read only the first line from the "firewall.user" file? And the second option is to read the first line after the "#" character.

delete everything but the line you want to read ?

this isn't openwrt related, but linux shell scripting.

2 Likes
head -n 1 /etc/firewall.user
3 Likes
  1. read reads a single line
  2. different-ways-to-print-next-few-lines

(but this is really not owrt related)

2 Likes