Skip to content
Snippets Groups Projects
Unverified Commit f69881da authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

fake: Cope with newer uci

Newer uci mandates flags are before commands. Older one doesn't mind
either way.
parent 79ac454d
No related branches found
No related tags found
No related merge requests found
#!/bin/sh #!/bin/sh
MARK_MASK=$(uci get -q ucollect.@fakes[0].mark_mask || echo 0xC0000) MARK_MASK=$(uci -q get ucollect.@fakes[0].mark_mask || echo 0xC0000)
PORT_OK="$(uci get -q ucollect.@fakes[0].mark_port_ok || echo 0x40000/$MARK_MASK)" PORT_OK="$(uci -q get ucollect.@fakes[0].mark_port_ok || echo 0x40000/$MARK_MASK)"
ADDR_OK="$(uci get -q ucollect.@fakes[0].mark_addr_ok || echo 0x80000/$MARK_MASK)" ADDR_OK="$(uci -q get ucollect.@fakes[0].mark_addr_ok || echo 0x80000/$MARK_MASK)"
REDIR="$(uci get -q ucollect.@fakes[0].mark_redir || echo 0xC0000/$MARK_MASK)" REDIR="$(uci -q get ucollect.@fakes[0].mark_redir || echo 0xC0000/$MARK_MASK)"
REDIR_OFFSET="$(uci get -q ucollect.@fakes[0].redir_offset || echo 1369)" REDIR_OFFSET="$(uci -q get ucollect.@fakes[0].redir_offset || echo 1369)"
# Get the list of ports and remove the ones that are disabled. We remove them by making sure # Get the list of ports and remove the ones that are disabled. We remove them by making sure
# that everything that is disabled appears at least twice and then take only the unique lines. # that everything that is disabled appears at least twice and then take only the unique lines.
PORTS=`( PORTS=`(
echo '23tcp' echo '23tcp'
uci get -q -d ' uci -q -d '
' ucollect.@fakes[0].disable ' get ucollect.@fakes[0].disable
uci get -q -d ' uci -q -d '
' ucollect.@fakes[0].disable ' get ucollect.@fakes[0].disable
) | sort | uniq -u` ) | sort | uniq -u`
# Locking. This may remove lock-file of other instance, but it does ensure we clean stray one eventually # Locking. This may remove lock-file of other instance, but it does ensure we clean stray one eventually
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment