Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
packaging
rpm-icingaweb2-module-ipl
Commits
b8a63808
Commit
b8a63808
authored
May 02, 2019
by
Markus Frosch
Browse files
Enable/Disable module automatically
parent
6eef87fd
Pipeline
#3896
passed with stages
in 13 minutes and 57 seconds
Changes
2
Pipelines
2
Show whitespace changes
Inline
Side-by-side
icinga-build-test
0 → 100755
View file @
b8a63808
#!/bin/bash
set
-e
module_name
=
ipl
echo
"Installing icingaweb2 module
${
module_name
}
"
icinga-build-rpm-install
"icingaweb2-module-
${
module_name
}
"
sudo
sh
-ex
<<
ROOT
ls -al /usr/share/icingaweb2/modules
find /etc/icingaweb2
if [ ! -L /etc/icingaweb2/enabledModules/
${
module_name
}
]; then
echo "Module is not enabled at /etc/icingaweb2/enabledModules/
${
module_name
}
" >&2
exit 1
fi
ROOT
icingaweb2-module-ipl.spec
View file @
b8a63808
...
...
@@ -40,6 +40,33 @@ cp -r * %{buildroot}%{basedir}
%clean
rm -rf %{buildroot}
%post
set -e
# Only for fresh installations
if [ $1 == 1 ]; then
if [ ! -d /etc/icingaweb2/enabledModules ]; then
mkdir /etc/icingaweb2/enabledModules
chmod g=rwx,o= /etc/icingaweb2/enabledModules
fi
echo "Enabling icingaweb2 module '%{module_name}'"
ln -svf /usr/share/icingaweb2/modules/%{module_name} /etc/icingaweb2/enabledModules/%{module_name}
fi
exit 0
%preun
set -e
# Only for removal
if [ $1 == 0 ]; then
echo "Disabling icingaweb2 module '%{module_name}'"
rm -f /etc/icingaweb2/enabledModules/%{module_name}
fi
exit 0
%files
%doc README.md
#LICENSE
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment