nadeko/nadeko_autorestart.sh

31 lines
975 B
Bash
Raw Normal View History

2017-06-07 13:19:32 +00:00
#!/bin/sh
if hash dotnet 2>/dev/null
then
echo "Dotnet installed."
else
echo "Dotnet is not installed. Please install dotnet."
exit 1
fi
2017-06-07 14:06:12 +00:00
echo ""
echo "Linking Nadeko Credentials"
mv -n /opt/NadekoBot/src/NadekoBot/credentials.json /root/nadeko/credentials.json > /dev/null 2>&1
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
2017-06-07 13:19:32 +00:00
2017-06-09 08:09:12 +00:00
echo ""
echo "Linking Nadeko Data Folder"
mkdir -p /root/nadeko/data
2017-06-21 08:45:47 +00:00
rsync --ignore-existing -rt /opt/NadekoBot/src/NadekoBot/bin/Release/netcoreapp1.1/data/ /root/nadeko/data/
2017-06-09 08:09:12 +00:00
rm -rf /opt/NadekoBot/src/NadekoBot/bin/Release/netcoreapp1.1/data/ > /dev/null 2>&1
2017-06-21 08:45:47 +00:00
ln -s /root/nadeko/data/ /opt/NadekoBot/src/NadekoBot/bin/Release/netcoreapp1.1/data > /dev/null 2>&1
2017-06-09 08:09:12 +00:00
echo ""
2017-06-07 13:19:32 +00:00
echo "Running NadekoBot with auto restart Please wait."
2017-06-09 08:09:12 +00:00
cd NadekoBot/src/NadekoBot
2017-06-07 13:19:32 +00:00
while :; do dotnet run -c Release; sleep 5s; done
echo "Done"
exit 0