You've already forked script-collection
light changes to wireshark script
This commit is contained in:
@@ -1,48 +1,40 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#set -xv
|
#set -xv
|
||||||
clear
|
|
||||||
echo "This script will install Wireshark using the ID"
|
|
||||||
echo "found in the /etc/os-release file. Currently, Fedora,"
|
|
||||||
echo "Ubuntu, Debian, and Arch are supported with this script."
|
|
||||||
echo "Feel free to edit it as needed."
|
|
||||||
|
|
||||||
DISTRO_ID=$(grep -i ^ID /etc/os-release | cut -c 4- | tr -d \")
|
if [[ $EUID -ne 0 ]]; then
|
||||||
read -p "Enter username: " USE
|
echo "This script needs to run as root."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
case "$DISTRO_ID" in
|
DISTRO_ID=$(grep -i '^ID=' /etc/os-release | cut -d= -f2 | tr -d '"')
|
||||||
[uU]buntu|[dD]ebian)
|
|
||||||
|
echo "Detected OS: $DISTRO_ID"
|
||||||
echo "Will now install and configure Wireshark"
|
echo "Installing Wireshark for the user $(logname)..."
|
||||||
echo "Press [Enter] to continue..."
|
case "$DISTRO_ID" in
|
||||||
apt install -y wireshark && gpasswd -a $USE wireshark
|
ubuntu|debian|raspbian)
|
||||||
|
echo "wireshark-common wireshark-common/install-setuid boolean true" | debconf-set-selections
|
||||||
|
apt update && apt install -y debconf-utils wireshark
|
||||||
|
usermod -aG wireshark $(logname)
|
||||||
chgrp wireshark /usr/bin/dumpcap
|
chgrp wireshark /usr/bin/dumpcap
|
||||||
chmod 755 /usr/bin/dumpcap
|
chmod 750 /usr/bin/dumpcap
|
||||||
setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap
|
setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap
|
||||||
echo "Rebooting to allow user to see network interfaces"
|
;;
|
||||||
|
|
||||||
;;
|
arch|manjaro)
|
||||||
|
pacman -Sy --noconfirm --needed wireshark-qt wireshark-cli
|
||||||
|
usermod -aG wireshark $(logname)
|
||||||
|
;;
|
||||||
|
|
||||||
[aA]rch)
|
fedora|centos|rhel|rocky|almalinux)
|
||||||
|
dnf install wireshark -y
|
||||||
echo "Will now install and configure Wireshark"
|
usermod -aG wireshark $(logname)
|
||||||
echo "Press [Enter] to continue..."
|
;;
|
||||||
pacman -S wireshark-qt wireshark-cli && gpasswd -a $USE wireshark
|
|
||||||
echo "Rebooting to allow user to see network interfaces"
|
|
||||||
|
|
||||||
;;
|
|
||||||
|
|
||||||
[fF]edora|[cC]entos|[rR]hel)
|
|
||||||
echo "Will now install and configure Wireshark"
|
|
||||||
echo "Press [Enter] to continue..."
|
|
||||||
dnf install wireshark -y && gpasswd -a $USE wireshark
|
|
||||||
echo "Rebooting to allow user to see network interfaces"
|
|
||||||
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
|
|
||||||
echo "Unknown OS.."
|
|
||||||
exit 0
|
|
||||||
|
|
||||||
;;
|
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo "Error: ${DISTRO_ID} is not currently supported..."
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
echo "Installation complete! Log out then log back in to ensure all interfaces to be available to Wireshark"
|
||||||
|
echo "If the interfaces are not available, then a reboot maybe required."
|
||||||
|
|||||||
Reference in New Issue
Block a user