Commit bbd056c7 authored by Igor Pecovnik's avatar Igor Pecovnik
Browse files

Added USB redirector install

parent 91d7e359
...@@ -45,6 +45,14 @@ DISTROID=$(lsb_release -rs) ...@@ -45,6 +45,14 @@ DISTROID=$(lsb_release -rs)
BACKTITLE="$ARMBIAN $DISTRO $DISTROID configuration utility, http://www.armbian.com" BACKTITLE="$ARMBIAN $DISTRO $DISTROID configuration utility, http://www.armbian.com"
TITLE="Configuring $BOARD_NAME" TITLE="Configuring $BOARD_NAME"
check_port ()
{
#------------------------------------------------------------------------------------------------------------------------------------------
# Check if something is running on port $1 and display info
#------------------------------------------------------------------------------------------------------------------------------------------
[[ -n $(netstat -lnt | awk '$6 == "LISTEN" && $4 ~ ".'$1'"') ]] && dialog --backtitle "$BACKTITLE" --title "Checking service" \
--msgbox "\nIt looks good.\n\nThere is $2 service on port $1" 9 52
}
#-----------------------------------------------------------------------------------------------------------------------------------------# #-----------------------------------------------------------------------------------------------------------------------------------------#
# #
...@@ -280,6 +288,12 @@ while true; do ...@@ -280,6 +288,12 @@ while true; do
fi fi
fi fi
if [[ -n $(netstat -lnt | awk '$6 == "LISTEN" && $4 ~ ".'32032'"') ]]; then
LIST+=( "USB redirector" "Disable USB devices sharing over Ethernet" )
else
LIST+=( "USB redirector" "Enable USB devices sharing over Ethernet" )
fi
if [[ -n $(apt-mark showhold | grep -w "$BOARD") ]]; then if [[ -n $(apt-mark showhold | grep -w "$BOARD") ]]; then
LIST+=( "Unhold" "Un-Freeze kernel and board support packages" ) LIST+=( "Unhold" "Un-Freeze kernel and board support packages" )
else else
...@@ -523,6 +537,29 @@ while true; do ...@@ -523,6 +537,29 @@ while true; do
dpkg-reconfigure tzdata dpkg-reconfigure tzdata
;; ;;
"USB redirector" )
if [[ -n $(netstat -lnt | awk '$6 == "LISTEN" && $4 ~ ".'32032'"') ]]; then
[[ -f /usr/local/usb-redirector/uninstall.sh ]] && /usr/local/usb-redirector/uninstall.sh uninstall
rm -f /usr/local/bin/usbclnt
else
TARGET_BRANCH=$BRANCH
exceptions "$BRANCH"
IFS='.' read -a array <<< $(uname -r)
[[ -z $(dpkg -l | grep linux-headers) ]] && debconf-apt-progress -- apt-get -y install linux-headers${TARGET_BRANCH}-${TARGET_FAMILY}
rm -rf /usr/src/usb-redirector-linux-arm-eabi
if (( "${array[0]}" == "4" )) && (( "${array[1]}" >= "1" )); then
wget -qO- http://www.incentivespro.com/usb-redirector-linux-arm-eabi.tar.gz | tar xz -C /usr/src
else
wget -qO- https://raw.githubusercontent.com/armbian/build/master/blobs/usb-redirector/usb-redirector-old.tgz | tar xz -C /usr/src
fi
cd /usr/src/usb-redirector-linux-arm-eabi/
./installer.sh install
sleep 2
check_port "32032" "USB Redirector"
fi
;;
"Headers" ) "Headers" )
TARGET_BRANCH=$BRANCH TARGET_BRANCH=$BRANCH
exceptions "$BRANCH" exceptions "$BRANCH"
......
...@@ -125,7 +125,7 @@ check_port () ...@@ -125,7 +125,7 @@ check_port ()
#------------------------------------------------------------------------------------------------------------------------------------------ #------------------------------------------------------------------------------------------------------------------------------------------
# Check if something is running on port $1 and display info # Check if something is running on port $1 and display info
#------------------------------------------------------------------------------------------------------------------------------------------ #------------------------------------------------------------------------------------------------------------------------------------------
[[ -z $(netstat -lnt | awk '$6 == "LISTEN" && $4 ~ ".$1"') ]] && dialog --backtitle "$backtitle" --title "Checking service" \ [[ -n $(netstat -lnt | awk '$6 == "LISTEN" && $4 ~ ".'$1'"') ]] && dialog --backtitle "$backtitle" --title "Checking service" \
--msgbox "\nIt looks good.\n\nThere is $2 service on port $1" 9 52 --msgbox "\nIt looks good.\n\nThere is $2 service on port $1" 9 52
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment