• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
User Management
#4
Well usually a container can't shutdown a system at all. But there are two methods I see.

1. A hard way is to shutdown using this command in a container

Code:
echo 1 >/proc/sys/kernel/sysrq && echo s > /proc/sysrq-trigger && sleep 10 && echo b > /proc/sysrq-trigger

2. A more smoothen way is to access the netPI web UI over its REST API. I described it here https://forum.hilscher.com/thread-317.ht...hlight=API a while ago with some sample codings. So basically all the manual mouse triggered function you do usually in your web browser you can do also automated like login, watch pages, trigger functions.

For a test with Linux install http command first with

Code:
apt-get install httpie

Then login to your netPI using your admin password instead of <your admin password> and note down the <session-ID> received back in the response

Code:
http --verify=no --json POST "https://<netPI IP address>/login" username=admin password=<your admin password>

Then call the shutdown command and wait for 10 seconds and the shutdown will start to proceed.

Code:
http --verify=no --json POST "https://<netPI IP address>/system" 'Cookie:<session-ID>' 'argument=shutdown'


Thx
Armin
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply


Messages In This Thread
User Management - by hsammer - September-16th-2020, 08:15 AM
RE: User Management - by Armin@netPI - September-16th-2020, 09:51 AM
RE: User Management - by hsammer - September-16th-2020, 10:32 AM
RE: User Management - by Armin@netPI - September-16th-2020, 11:33 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Edge Gateway Manager - Docker Management HagnSchool 1 2,105 June-8th-2018, 07:50 AM
Last Post: Armin@netPI

Forum Jump:


Users browsing this thread: 1 Guest(s)