Disable shutdown/reboot unless on Raspberry Pi
This commit is contained in:
parent
9fcef552cc
commit
02afe06655
2 changed files with 10 additions and 3 deletions
|
|
@ -1,8 +1,16 @@
|
|||
from openflexure_microscope.api.views import MicroscopeView
|
||||
|
||||
import subprocess
|
||||
import os
|
||||
from sys import platform
|
||||
|
||||
|
||||
def is_raspberrypi():
|
||||
if (platform != "linux"):
|
||||
return False
|
||||
else:
|
||||
return (os.uname()[1] == 'raspberrypi')
|
||||
|
||||
class ShutdownAPI(MicroscopeView):
|
||||
"""
|
||||
Attempt to shutdown the device
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue