Skip to content

Commit

Permalink
added interface setting
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippMundhenk committed Oct 29, 2023
1 parent 189bd59 commit e50e982
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ RUN apt-get -y install \
php-cgi \
php-curl \
sudo \
iproute2 \
&& apt-get -y clean

RUN cd /tmp && \
Expand Down
5 changes: 5 additions & 0 deletions files/runScanner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ touch /var/log/scanner.log
chown $USERNAME /var/log/scanner.log
env > /opt/brother/scanner/env.txt
chmod -R 777 /opt/brother

subnet=$(echo $IPADDRESS | sed 's/\([0-9]*\.[0-9]*\.\)[0-9]*\.[0-9]*/\1/')
interface=$(ip addr show | grep -B10 $subnet | grep mtu | tail -1 | sed 's/[0-9]*: \(.*\): .*/\1/')
echo "eth=$interface\n" >> /opt/brother/scanner/brscan-skey/brscan-skey.config

su - $USERNAME -c "/usr/bin/brsaneconfig4 -a name=$NAME model=$MODEL ip=$IPADDRESS"
su - $USERNAME -c "/usr/bin/brscan-skey"

Expand Down

0 comments on commit e50e982

Please sign in to comment.