Skip to content

Commit 08d8dc7

Browse files
committed
add install scripts
1 parent f883819 commit 08d8dc7

File tree

5 files changed

+33
-3
lines changed

5 files changed

+33
-3
lines changed

package/after-install.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
3+
# This file is used by deb, rpm and BSD packages.
4+
# FPM adds this as the after-install script.
5+
6+
mkdir -p '/var/log/fogwillow'
7+
8+
if [ -x "/bin/systemctl" ]; then
9+
# Reload and restart - this starts the application as user nobody.
10+
/bin/systemctl daemon-reload
11+
/bin/systemctl enable unpackerr
12+
/bin/systemctl restart unpackerr
13+
fi

package/before-install.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
3+
# This file is used by deb, rpm and BSD packages.
4+
# FPM adds this as the before-install script.

package/before-remove.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
3+
# This file is used by rpm and deb packages. FPM use.
4+
5+
if [ "$1" = "upgrade" ] || [ "$1" = "1" ] ; then
6+
exit 0
7+
fi
8+
9+
if [ -x "/bin/systemctl" ]; then
10+
/bin/systemctl stop fogwillow
11+
/bin/systemctl disable fogwillow
12+
fi

package/fogwillow.service

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ After=network-online.target
77
[Service]
88
ExecStart=/usr/bin/fogwillow -c /etc/fogwillow/fog.conf
99
EnvironmentFile=-/etc/default/fogwillow
10+
Environment=FW_LOG_FILE=/var/log/fogwillow/fog.log
1011
Restart=always
1112
RestartSec=10
1213
SyslogIdentifier=fogwillow

package/package.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ PACKAGE_NAME="fogwillow"
2323
##
2424

2525
read -r -d '' PACKAGE_ARGS <<- PACKAGE_ARGS
26-
--after-install after-install.sh
27-
--before-install before-install.sh
28-
--before-remove before-remove.sh
26+
--after-install package/after-install.sh
27+
--before-install package/before-install.sh
28+
--before-remove package/before-remove.sh
2929
--deb-no-default-config-files
3030
--description='${DESC}'
3131
--iteration ${ITERATION}

0 commit comments

Comments
 (0)