Skip to content

Instantly share code, notes, and snippets.

@pqviet07
Last active June 2, 2023 15:37
Show Gist options
  • Save pqviet07/86bf75803e448bc8639450d456b64cc1 to your computer and use it in GitHub Desktop.
Save pqviet07/86bf75803e448bc8639450d456b64cc1 to your computer and use it in GitHub Desktop.
Kill process then build and run dotnet core app
#!/bin/bash
#Kill process then re-build and run
pid=`ps aux | grep LuongThangScraper | grep -v grep | awk {'print $2'}`
if [ -z "$pid" ]
then
echo "LuongThangScraper not found!"
else
echo "LuongThangScraper running on PID = " $pid
kill -9 "$pid"
echo "LuongThangScraper terminated"
fi
dotnet build -c Release -o "bin/Release/net7.0"
param="$1"
cd "bin/Release/net7.0"
exec ./LuongThangScraper "$param" &!
echo "~~~~~ Build & Run Successed ~~~~~~~~~"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment