mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-05 06:49:19 +00:00
Documentation, show pid in x-open-ports, tweaks
This commit is contained in:
@@ -81,15 +81,15 @@ function section_dotfiles
|
||||
|
||||
case "$1" in
|
||||
link)
|
||||
rcup -B "$HOSTNAME" -v && echo "🎉 Done!"
|
||||
rcup -B "$HOSTNAME" -f -v && echo "🎉 Done!"
|
||||
;;
|
||||
update)
|
||||
# Updates .dotfiles/scripts/install.sh and formats it
|
||||
rcup -B 0 -g \
|
||||
| tee "$INSTALL_SCRIPT" 1> /dev/null \
|
||||
&& shfmt -w -l "$INSTALL_SCRIPT" \
|
||||
&& sed -i '' "s|$HOME|\$HOME|g" "$INSTALL_SCRIPT" \
|
||||
&& echo "🎉 Done!"
|
||||
&& sed -i '' "s|$HOME|\$HOME|g" "$INSTALL_SCRIPT"
|
||||
$0 dotfiles shfmt
|
||||
echo "🎉 Done!"
|
||||
;;
|
||||
shfmt)
|
||||
# Format shell scripts according to following rules.
|
||||
|
||||
@@ -6,14 +6,15 @@
|
||||
# Originally from: https://www.commandlinefu.com/commands/view/8951
|
||||
# Original author: https://www.commandlinefu.com/commands/by/wickedcpj
|
||||
#
|
||||
echo 'User: Command: Port:'
|
||||
echo '====================================================='
|
||||
echo 'User: Command: PID: Port:'
|
||||
echo '========================================================='
|
||||
|
||||
lsof -i 4 -P -n +c 0 \
|
||||
| grep -i 'listen' \
|
||||
| awk '{print $3, $1, $9}' \
|
||||
| awk '{print $3, $1, $2, $9}' \
|
||||
| sed 's/ [a-z0-9\.\*]*:/ /' \
|
||||
| sort -k 3 -n \
|
||||
| xargs printf '%-20s %-25s %-5s\n' | uniq
|
||||
| xargs printf '%-15s %-25s %-8s %-5s\n' \
|
||||
| uniq
|
||||
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user