Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e17206a

Browse files
committed
add check for ifconfig
1 parent 159043c commit e17206a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

‎install.sh‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,17 @@ configure_static_ip() {
548548
fi
549549
fi
550550

551+
# Check if ifconfig is available, and if not, prompt the user to install it
552+
if ! command -v ifconfig &>/dev/null; then
553+
read -rp "ifconfig is not installed. Do you want to install it? (Y/n): " install_ifconfig
554+
if [[ "$install_ifconfig" =~ ^[Yy]$ ]]; then
555+
sudo apt install net-tools -y
556+
else
557+
echo "ifconfig is required to list network devices. Exiting."
558+
exit 1
559+
fi
560+
fi
561+
551562
# Get network device information from 'ifconfig -a'
552563
device_info=$(ifconfig -a)
553564

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /