···11+#!/bin/zsh
22+33+# Potential source paths
44+PATH_ROOT="dissector/pro_dj_link.lua"
55+PATH_LOCAL="pro_dj_link.lua"
66+77+# Use $HOME to make it work for any user
88+DESTINATION="$HOME/.local/lib/wireshark/plugins/"
99+1010+# Determine which path is valid
1111+if [[ -f "$PATH_ROOT" ]]; then
1212+ SOURCE="$PATH_ROOT"
1313+elif [[ -f "$PATH_LOCAL" ]]; then
1414+ SOURCE="$PATH_LOCAL"
1515+else
1616+ print "Error: pro_dj_link.lua not found in current or 'dissector' directory."
1717+ exit 1
1818+fi
1919+2020+# Ensure the destination directory exists
2121+mkdir -p "$DESTINATION"
2222+2323+# Execute copy
2424+cp "$SOURCE" "$DESTINATION"
2525+print "Successfully installed $SOURCE to $DESTINATION"