Switched back to using a shell script for the wrapper, simplified service config to one service
This commit is contained in:
parent
cdf6ebc219
commit
99d4b9218e
|
|
@ -1,10 +1,12 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
|
||||||
# Obtain sleep-time value
|
listen_port="$(snapctl get novncsvc.listen_port)"
|
||||||
sleep_time="$(snapctl get sleep-time)"
|
vnc_host_port="$(snapctl get novncsvc.vnc_host_port)"
|
||||||
|
|
||||||
# Validate it
|
# Validate listen_port
|
||||||
if ! expr "$sleep_time" : '^[0-9]*$' > /dev/null; then
|
if ! expr "$listen_port" : '^[0-9]\+$' > /dev/null; then
|
||||||
echo "\"$sleep_time\" is not a valid sleep time" >&2
|
echo "\"$listen_port\" is not a valid port number" >&2
|
||||||
exit 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
snapctl restart novncsvc
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,6 @@ apps:
|
||||||
command: utils/launch.sh
|
command: utils/launch.sh
|
||||||
plugs: [network, network-bind]
|
plugs: [network, network-bind]
|
||||||
novncsvc:
|
novncsvc:
|
||||||
command: utils/svc_wrapper.py
|
command: utils/svc_wrapper.sh
|
||||||
daemon: simple
|
daemon: simple
|
||||||
plugs: [network, network-bind]
|
plugs: [network, network-bind]
|
||||||
|
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
#!/usr/bin/bash
|
||||||
|
|
||||||
|
listen_port="$(snapctl get novncsvc.listen_port)"
|
||||||
|
vnc_host_port="$(snapctl get novncsvc.vnc_host_port)"
|
||||||
|
|
||||||
|
utils/launch.sh --listen $listen_port --vnc $vnc_host_port
|
||||||
Loading…
Reference in New Issue