File tree 2 files changed +17
-14
lines changed
2 files changed +17
-14
lines changed Original file line number Diff line number Diff line change @@ -42,16 +42,21 @@ cp contrib/macos/yggdrasil.plist pkgbuild/root/Library/LaunchDaemons
42
42
cat > pkgbuild/scripts/postinstall << EOF
43
43
#!/bin/sh
44
44
45
+ conf_file=/usr/local/etc/yggdrasil.conf
46
+
47
+ # Handle old path
48
+ [ -f /etc/yggdrasil.conf ] && mv /etc/yggdrasil.conf $conf_file
49
+
45
50
# Normalise the config if it exists, generate it if it doesn't
46
- if [ -f /etc/yggdrasil.conf ];
51
+ if [ -f $conf_file ];
47
52
then
48
53
mkdir -p /Library/Preferences/Yggdrasil
49
54
echo "Backing up configuration file to /Library/Preferences/Yggdrasil/yggdrasil.conf.` date +%Y%m%d` "
50
- cp /etc/yggdrasil.conf /Library/Preferences/Yggdrasil/yggdrasil.conf.` date +%Y%m%d`
51
- echo "Normalising /etc/yggdrasil.conf "
52
- /usr/local/bin/yggdrasil -useconffile /Library/Preferences/Yggdrasil/yggdrasil.conf.` date +%Y%m%d` -normaliseconf > /etc/yggdrasil.conf
55
+ cp $conf_file /Library/Preferences/Yggdrasil/yggdrasil.conf.` date +%Y%m%d`
56
+ echo "Normalising $conf_file "
57
+ /usr/local/bin/yggdrasil -useconffile /Library/Preferences/Yggdrasil/yggdrasil.conf.` date +%Y%m%d` -normaliseconf > $conf_file
53
58
else
54
- /usr/local/bin/yggdrasil -genconf > /etc/yggdrasil.conf
59
+ /usr/local/bin/yggdrasil -genconf > $conf_file
55
60
fi
56
61
57
62
# Unload existing Yggdrasil launchd service, if possible
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" UTF-8" ?>
2
2
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
3
<plist version =" 1.0" >
4
- <dict >
4
+ <dict >
5
5
<key >Label </key >
6
6
<string >yggdrasil </string >
7
7
<key >ProgramArguments </key >
8
8
<array >
9
- <string >sh </string >
10
- <string >-c </string >
11
- <string >/usr/local/bin/yggdrasil -useconffile /etc/yggdrasil.conf </string >
9
+ <string >/usr/local/bin/yggdrasil </string >
10
+ <string >-useconffile </string >
11
+ <string >/usr/local/etc/yggdrasil.conf </string >
12
12
</array >
13
13
<key >KeepAlive </key >
14
14
<true />
15
15
<key >RunAtLoad </key >
16
16
<true />
17
- <key >ProcessType </key >
18
- <string >Interactive </string >
19
17
<key >StandardOutPath </key >
20
- <string >/tmp/ yggdrasil.stdout .log </string >
18
+ <string >/Library/Logs/ yggdrasil.log </string >
21
19
<key >StandardErrorPath </key >
22
- <string >/tmp/ yggdrasil.stderr .log </string >
23
- </dict >
20
+ <string >/Library/Logs/ yggdrasil.log </string >
21
+ </dict >
24
22
</plist >
You can’t perform that action at this time.
0 commit comments