Create nadeko_autorestart.sh

This commit is contained in:
Poag 2017-06-09 09:09:12 +01:00 committed by GitHub
parent 6b0000f980
commit 365c0890c6

View File

@ -10,8 +10,7 @@ fi
echo ""
echo "Linking Nadeko DB"
mkdir /root/nadeko
mkdir -p /root/nadeko
mv -n /opt/NadekoBot/src/NadekoBot/bin/Release/netcoreapp1.1/data/NadekoBot.db /root/nadeko/NadekoBot.db > /dev/null 2>&1
rm /opt/NadekoBot/src/NadekoBot/bin/Release/netcoreapp1.1/data/NadekoBot.db > /dev/null 2>&1
ln -s /root/nadeko/NadekoBot.db /opt/NadekoBot/src/NadekoBot/bin/Release/netcoreapp1.1/data/NadekoBot.db > /dev/null 2>&1
@ -22,8 +21,17 @@ mv -n /opt/NadekoBot/src/NadekoBot/credentials.json /root/nadeko/credentials.jso
rm /opt/NadekoBot/src/NadekoBot/credentials.json > /dev/null 2>&1
ln -s /root/nadeko/credentials.json /opt/NadekoBot/src/NadekoBot/credentials.json > /dev/null 2>&1
cd NadekoBot/src/NadekoBot
echo ""
echo "Linking Nadeko Data Folder"
mkdir -p /root/nadeko/data
cp -rvn /opt/NadekoBot/src/NadekoBot/bin/Release/netcoreapp1.1/data/* /root/nadeko/data/
rm -rf /opt/NadekoBot/src/NadekoBot/bin/Release/netcoreapp1.1/data/ > /dev/null 2>&1
mkdir -p /opt/NadekoBot/src/NadekoBot/bin/Release/netcoreapp1.1/data/ > /dev/null 2>&1
ln -s /opt/NadekoBot/src/NadekoBot/bin/Release/netcoreapp1.1/data/ /root/nadeko/ > /dev/null 2>&1
echo ""
echo "Running NadekoBot with auto restart Please wait."
cd NadekoBot/src/NadekoBot
while :; do dotnet run -c Release; sleep 5s; done
echo "Done"