diff --git a/onionr/httpapi/miscclientapi/endpoints.py b/onionr/httpapi/miscclientapi/endpoints.py index d4b903e6..4062e2ec 100644 --- a/onionr/httpapi/miscclientapi/endpoints.py +++ b/onionr/httpapi/miscclientapi/endpoints.py @@ -27,6 +27,7 @@ from serializeddata import SerializedData from onionrutils import mnemonickeys from onionrutils import bytesconverter from utils import reconstructhash +from onionrcommands import restartonionr pub_key = onionrcrypto.pub_key.replace('=', '') @@ -90,6 +91,11 @@ class PrivateEndpoints: @private_endpoints_bp.route('/shutdown') def shutdown(): return apiutils.shutdown.shutdown(client_api) + + @private_endpoints_bp.route('/restartclean') + def restart_clean(): + restartonionr.restart() + return Response("bye") @private_endpoints_bp.route('/getstats') def getStats(): diff --git a/onionr/onionrcommands/restartonionr.py b/onionr/onionrcommands/restartonionr.py index 996ab406..1abe3620 100644 --- a/onionr/onionrcommands/restartonionr.py +++ b/onionr/onionrcommands/restartonionr.py @@ -35,6 +35,7 @@ def restart(): daemonlaunch.kill_daemon() while localcommand.local_command('ping', maxWait=8) == 'pong!': time.sleep(0.3) + time.sleep(4) subprocess.Popen([SCRIPT_NAME, 'start']) restart.onionr_help = 'Gracefully restart Onionr' diff --git a/onionr/static-data/www/private/index.html b/onionr/static-data/www/private/index.html index 2ba75af9..4096a367 100755 --- a/onionr/static-data/www/private/index.html +++ b/onionr/static-data/www/private/index.html @@ -9,6 +9,7 @@ Onionr + @@ -100,7 +101,9 @@
@@ -120,7 +123,7 @@- Onionr + Onionr Sites
Statistics
+