Initial commit
This commit is contained in:
17
snap/hooks/configure
vendored
Executable file
17
snap/hooks/configure
vendored
Executable file
@ -0,0 +1,17 @@
|
||||
#! /usr/bin/python3
|
||||
|
||||
import os
|
||||
import configparser
|
||||
|
||||
CONFIG_FILE=os.environ['SNAP_DATA'] + '/config'
|
||||
KEYS=['updateipv4', 'updateipv6', 'domain', 'password', 'ipv4hostname', 'ipv6hostname']
|
||||
|
||||
config = configparser.ConfigParser()
|
||||
config.read(CONFIG_FILE)
|
||||
|
||||
for key in KEYS:
|
||||
value = os.popen('snapctl get ' + key).read()
|
||||
config.set('User', key, value)
|
||||
|
||||
with open(CONFIG_FILE, 'w') as configfile:
|
||||
config.write(configfile)
|
8
snap/hooks/install
Executable file
8
snap/hooks/install
Executable file
@ -0,0 +1,8 @@
|
||||
#! /bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
cp $SNAP/default.conf $SNAP_DATA/config
|
||||
# The config file should not be world readable, but the snap user can't read it
|
||||
# either if it is chmodded. How to solve this?
|
||||
#chmod 600 $SNAP_DATA/config
|
Reference in New Issue
Block a user