mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-05-20 00:45:06 +03:00
Merge eebee5f6f9
into 47818a1a7c
This commit is contained in:
commit
e7f9272091
8 changed files with 8 additions and 6 deletions
|
@ -3,7 +3,7 @@
|
||||||
CONFFILE="/etc/yggdrasil.conf"
|
CONFFILE="/etc/yggdrasil.conf"
|
||||||
|
|
||||||
genconf() {
|
genconf() {
|
||||||
/usr/bin/yggdrasil -genconf > "$1"
|
(umask 037 && /usr/bin/yggdrasil -genconf > "$1")
|
||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,7 @@ then
|
||||||
chmod 640 /etc/yggdrasil/yggdrasil.conf
|
chmod 640 /etc/yggdrasil/yggdrasil.conf
|
||||||
else
|
else
|
||||||
echo "Generating initial configuration file /etc/yggdrasil/yggdrasil.conf"
|
echo "Generating initial configuration file /etc/yggdrasil/yggdrasil.conf"
|
||||||
/usr/bin/yggdrasil -genconf > /etc/yggdrasil/yggdrasil.conf
|
(umask 037 && /usr/bin/yggdrasil -genconf > /etc/yggdrasil/yggdrasil.conf)
|
||||||
|
|
||||||
chown root:yggdrasil /etc/yggdrasil/yggdrasil.conf
|
chown root:yggdrasil /etc/yggdrasil/yggdrasil.conf
|
||||||
chmod 640 /etc/yggdrasil/yggdrasil.conf
|
chmod 640 /etc/yggdrasil/yggdrasil.conf
|
||||||
|
|
|
@ -6,7 +6,7 @@ CONF_DIR="/etc/yggdrasil-network"
|
||||||
|
|
||||||
if [ ! -f "$CONF_DIR/config.conf" ]; then
|
if [ ! -f "$CONF_DIR/config.conf" ]; then
|
||||||
echo "generate $CONF_DIR/config.conf"
|
echo "generate $CONF_DIR/config.conf"
|
||||||
yggdrasil --genconf > "$CONF_DIR/config.conf"
|
(umask 037 && yggdrasil --genconf > "$CONF_DIR/config.conf")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
yggdrasil --useconf < "$CONF_DIR/config.conf"
|
yggdrasil --useconf < "$CONF_DIR/config.conf"
|
||||||
|
|
|
@ -33,7 +33,7 @@ yggdrasil_start()
|
||||||
|
|
||||||
test ! -f /etc/yggdrasil.conf && (
|
test ! -f /etc/yggdrasil.conf && (
|
||||||
logger -s -t yggdrasil "Generating new configuration file into /etc/yggdrasil.conf"
|
logger -s -t yggdrasil "Generating new configuration file into /etc/yggdrasil.conf"
|
||||||
/usr/local/bin/yggdrasil -genconf > /etc/yggdrasil.conf
|
(umask 037 && /usr/local/bin/yggdrasil -genconf > /etc/yggdrasil.conf)
|
||||||
)
|
)
|
||||||
|
|
||||||
tap_path="$(cat /etc/yggdrasil.conf | egrep -o '/dev/tap[0-9]{1,2}$')"
|
tap_path="$(cat /etc/yggdrasil.conf | egrep -o '/dev/tap[0-9]{1,2}$')"
|
||||||
|
|
|
@ -55,7 +55,7 @@ then
|
||||||
echo "Normalising /etc/yggdrasil.conf"
|
echo "Normalising /etc/yggdrasil.conf"
|
||||||
/usr/local/bin/yggdrasil -useconffile /Library/Preferences/Yggdrasil/yggdrasil.conf.`date +%Y%m%d` -normaliseconf > /etc/yggdrasil.conf
|
/usr/local/bin/yggdrasil -useconffile /Library/Preferences/Yggdrasil/yggdrasil.conf.`date +%Y%m%d` -normaliseconf > /etc/yggdrasil.conf
|
||||||
else
|
else
|
||||||
/usr/local/bin/yggdrasil -genconf > /etc/yggdrasil.conf
|
(umask 037 && /usr/local/bin/yggdrasil -genconf > /etc/yggdrasil.conf)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Unload existing Yggdrasil launchd service, if possible
|
# Unload existing Yggdrasil launchd service, if possible
|
||||||
|
|
|
@ -14,7 +14,7 @@ depend() {
|
||||||
start_pre() {
|
start_pre() {
|
||||||
if [ ! -f "${CONFFILE}" ]; then
|
if [ ! -f "${CONFFILE}" ]; then
|
||||||
ebegin "Generating new configuration file into ${CONFFILE}"
|
ebegin "Generating new configuration file into ${CONFFILE}"
|
||||||
if ! eval ${command} -genconf > ${CONFFILE}; then
|
if ! (umask 037 && eval ${command} -genconf > ${CONFFILE}); then
|
||||||
eerror "Failed to generate configuration file"
|
eerror "Failed to generate configuration file"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -8,6 +8,7 @@ After=local-fs.target
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
Group=yggdrasil
|
Group=yggdrasil
|
||||||
|
UMask=037
|
||||||
StandardOutput=file:/etc/yggdrasil.conf
|
StandardOutput=file:/etc/yggdrasil.conf
|
||||||
ExecStart=/usr/bin/yggdrasil -genconf
|
ExecStart=/usr/bin/yggdrasil -genconf
|
||||||
ExecStartPost=/usr/bin/chmod 0640 /etc/yggdrasil.conf
|
ExecStartPost=/usr/bin/chmod 0640 /etc/yggdrasil.conf
|
||||||
|
|
|
@ -8,6 +8,7 @@ After=local-fs.target
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
Group=yggdrasil
|
Group=yggdrasil
|
||||||
|
UMask=037
|
||||||
ExecStartPre=/usr/bin/mkdir -p /etc/yggdrasil
|
ExecStartPre=/usr/bin/mkdir -p /etc/yggdrasil
|
||||||
ExecStart=/usr/bin/yggdrasil -genconf > /etc/yggdrasil/yggdrasil.conf
|
ExecStart=/usr/bin/yggdrasil -genconf > /etc/yggdrasil/yggdrasil.conf
|
||||||
ExecStartPost=/usr/bin/chmod -R 0640 /etc/yggdrasil
|
ExecStartPost=/usr/bin/chmod -R 0640 /etc/yggdrasil
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue