GBSA-392: Merged startup logic from daemon into setupFunctions#24
Conversation
Daniel-Lopez246
left a comment
There was a problem hiding this comment.
Please go back and only make the necessary changes within your assigned function, or else you will cause merging errors!
Daniel-Lopez246
left a comment
There was a problem hiding this comment.
resolve merge conflicts
Review completed. This PR has critical issues that prevent it from functioning correctly. The merge is incomplete and introduces syntax errors. Issues Found:
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
| function setup_infrastructure { | ||
| trap 'echo -e "$(date) Error in Cybercafe_setupFunctions.sh: Line ${LINENO}\n" >> error.log' ERR > /dev/null 2>> error.log | ||
|
|
||
| LOCAL_IP=$(ifconfig $HS_INTERFACE | grep 'inet addr' | awk '{print $2}' | cut -d: -f2) > /dev/null 2>> error.log | ||
|
|
||
| ############################################################ | ||
| # iptmon_tx | ||
| ############################################################ | ||
| iptables -t mangle -C FORWARD -i ${HS_INTERFACE} -j iptmon_tx > /dev/null 2>> error.log | ||
| if [[ $? -ne 0 ]]; then | ||
| iptables -t mangle -N iptmon_tx > /dev/null 2>> error.log | ||
| iptables -t mangle -A FORWARD -i ${HS_INTERFACE} -j iptmon_tx > /dev/null 2>> error.log | ||
| fi | ||
|
|
||
| ############################################################ | ||
| # iptmon_rx | ||
| ############################################################ | ||
| iptables -t mangle -C POSTROUTING -o ${HS_INTERFACE} -j iptmon_rx > /dev/null 2>> error.log | ||
| if [[ $? -ne 0 ]]; then | ||
| iptables -t mangle -N iptmon_rx > /dev/null 2>> error.log | ||
| iptables -t mangle -I iptmon_rx 1 -s ${LOCAL_IP} -j RETURN > /dev/null 2>> error.log | ||
| iptables -t mangle -A POSTROUTING -o ${HS_INTERFACE} -j iptmon_rx > /dev/null 2>> error.log | ||
| fi | ||
|
|
||
| ############################################################ | ||
| # NAT redirect rules (captive portal) | ||
| ############################################################ | ||
| iptables -t nat -C PREROUTING -p tcp -i ${HS_INTERFACE} -j DNAT --to-destination ${LOCAL_IP}:80 > /dev/null 2>> error.log | ||
| if [[ $? -ne 0 ]]; then | ||
| iptables -t nat -I PREROUTING 1 -p tcp -i ${HS_INTERFACE} -j DNAT --to-destination ${LOCAL_IP}:80 > /dev/null 2>> error.log | ||
|
|
||
| iptables -t nat -A PREROUTING -p udp -i ${HS_INTERFACE} -d ${LOCAL_IP} --dport 53 -j RETURN > /dev/null 2>> error.log | ||
| iptables -t nat -A PREROUTING -p udp -i ${HS_INTERFACE} -s 0.0.0.0/32 -d 255.255.255.255/32 --dport 67 -j RETURN > /dev/null 2>> error.log | ||
|
|
||
| iptables -t filter -I FORWARD 1 -p all -i ${HS_INTERFACE} -j DROP > /dev/null 2>> error.log | ||
| iptables -t filter -I FORWARD 1 -p all -o ${HS_INTERFACE} ! -s ${LOCAL_IP} -j DROP > /dev/null 2>> error.log | ||
| fi |
There was a problem hiding this comment.
The first setup_infrastructure function definition starting at line 84 is missing its closing brace. This creates a syntax error that will cause the script to fail when sourced or executed. The function body ends at line 120 but there's no closing } before the duplicate function definition at line 124.
Fix it with Roo Code or mention @roomote and request a fix.
|
|
||
| iptables -t filter -I FORWARD 1 -p all -i ${HS_INTERFACE} -j DROP > /dev/null 2>> error.log | ||
| iptables -t filter -I FORWARD 1 -p all -o ${HS_INTERFACE} ! -s ${LOCAL_IP} -j DROP > /dev/null 2>> error.log | ||
| fi |
There was a problem hiding this comment.
Incomplete merge detected: The traffic control (TC) setup code that was supposed to be merged from the daemon is missing here. According to the PR diff, this function should include TC qdisc/class configuration (lines setting up htb queuing with rate limits). The function is also missing its closing brace, causing a syntax error. The complete merged version should include TC setup and the captive portal start logic, followed by a closing }.
Fix it with Roo Code or mention @roomote and request a fix.
baca482
into
grey-box:Feature/Utility-Library-(ASU-CIDSE-2025-Fall)
This PR merges the startup logic from CyberCafe_Daemon.sh into Cybercafe_setupFunctions.sh as required for GBSA-392.
Only one file was changed under Backend/.