mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 14:15:06 +03:00
Merge 573574c8b6
into 5b8dbc8b1e
This commit is contained in:
commit
005ecbac26
2 changed files with 18 additions and 14 deletions
|
@ -46,16 +46,22 @@ cp contrib/macos/yggdrasil.plist pkgbuild/root/Library/LaunchDaemons
|
||||||
cat > pkgbuild/scripts/postinstall << EOF
|
cat > pkgbuild/scripts/postinstall << EOF
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
mkdir -p /usr/local/etc
|
||||||
|
conf_file=/usr/local/etc/yggdrasil.conf
|
||||||
|
|
||||||
|
# Handle old path
|
||||||
|
[ -f /etc/yggdrasil.conf ] && mv /etc/yggdrasil.conf $conf_file
|
||||||
|
|
||||||
# Normalise the config if it exists, generate it if it doesn't
|
# Normalise the config if it exists, generate it if it doesn't
|
||||||
if [ -f /etc/yggdrasil.conf ];
|
if [ -f $conf_file ];
|
||||||
then
|
then
|
||||||
mkdir -p /Library/Preferences/Yggdrasil
|
mkdir -p /Library/Preferences/Yggdrasil
|
||||||
echo "Backing up configuration file to /Library/Preferences/Yggdrasil/yggdrasil.conf.`date +%Y%m%d`"
|
echo "Backing up configuration file to /Library/Preferences/Yggdrasil/yggdrasil.conf.`date +%Y%m%d`"
|
||||||
cp /etc/yggdrasil.conf /Library/Preferences/Yggdrasil/yggdrasil.conf.`date +%Y%m%d`
|
cp $conf_file /Library/Preferences/Yggdrasil/yggdrasil.conf.`date +%Y%m%d`
|
||||||
echo "Normalising /etc/yggdrasil.conf"
|
echo "Normalising $conf_file"
|
||||||
/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 > $conf_file
|
||||||
else
|
else
|
||||||
/usr/local/bin/yggdrasil -genconf > /etc/yggdrasil.conf
|
/usr/local/bin/yggdrasil -genconf > $conf_file
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Unload existing Yggdrasil launchd service, if possible
|
# Unload existing Yggdrasil launchd service, if possible
|
||||||
|
|
|
@ -1,24 +1,22 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>Label</key>
|
<key>Label</key>
|
||||||
<string>yggdrasil</string>
|
<string>yggdrasil</string>
|
||||||
<key>ProgramArguments</key>
|
<key>ProgramArguments</key>
|
||||||
<array>
|
<array>
|
||||||
<string>sh</string>
|
<string>/usr/local/bin/yggdrasil</string>
|
||||||
<string>-c</string>
|
<string>-useconffile</string>
|
||||||
<string>/usr/local/bin/yggdrasil -useconffile /etc/yggdrasil.conf</string>
|
<string>/usr/local/etc/yggdrasil.conf</string>
|
||||||
</array>
|
</array>
|
||||||
<key>KeepAlive</key>
|
<key>KeepAlive</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>RunAtLoad</key>
|
<key>RunAtLoad</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>ProcessType</key>
|
|
||||||
<string>Interactive</string>
|
|
||||||
<key>StandardOutPath</key>
|
<key>StandardOutPath</key>
|
||||||
<string>/tmp/yggdrasil.stdout.log</string>
|
<string>/Library/Logs/yggdrasil.log</string>
|
||||||
<key>StandardErrorPath</key>
|
<key>StandardErrorPath</key>
|
||||||
<string>/tmp/yggdrasil.stderr.log</string>
|
<string>/Library/Logs/yggdrasil.log</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue