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
|
||||
|
||||
# Obtain sleep-time value
|
||||
sleep_time="$(snapctl get sleep-time)"
|
||||
listen_port="$(snapctl get novncsvc.listen_port)"
|
||||
vnc_host_port="$(snapctl get novncsvc.vnc_host_port)"
|
||||
|
||||
# Validate it
|
||||
if ! expr "$sleep_time" : '^[0-9]*$' > /dev/null; then
|
||||
echo "\"$sleep_time\" is not a valid sleep time" >&2
|
||||
exit 1
|
||||
# Validate listen_port
|
||||
if ! expr "$listen_port" : '^[0-9]\+$' > /dev/null; then
|
||||
echo "\"$listen_port\" is not a valid port number" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
snapctl restart novncsvc
|
||||
|
|
|
|||
|
|
@ -26,6 +26,6 @@ apps:
|
|||
command: utils/launch.sh
|
||||
plugs: [network, network-bind]
|
||||
novncsvc:
|
||||
command: utils/svc_wrapper.py
|
||||
command: utils/svc_wrapper.sh
|
||||
daemon: simple
|
||||
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