Last active
June 2, 2023 15:37
-
-
Save pqviet07/86bf75803e448bc8639450d456b64cc1 to your computer and use it in GitHub Desktop.
Kill process then build and run dotnet core app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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