-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path+POST_INSTALL
24 lines (19 loc) · 916 Bytes
/
+POST_INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh
# update the ThreatPatrols repo config file from .template
/usr/local/opnsense/scripts/ThreatPatrols/Repo/repo_actions.sh update
/usr/local/opnsense/scripts/ThreatPatrols/Repo/widget_actions.sh insert || (echo "ERROR: failed to insert dashboard widget")
# Rebuild system-menus and plugin-templates
/usr/local/etc/rc.configure_plugins
# Restart configd with latest templates
service configd restart
# Causes os-threatpatrols to reinstall >if< package was not installed from repository
if [ ! -f /tmp/reinstall-os-threatpatrols ]; then
if [ $(pkg info --annotations os-threatpatrols | wc -l | tr -d "[:blank:]") -gt 0 ]; then
if [ $(pkg info --annotations os-threatpatrols | grep -c repository) -eq 0 ]; then
date > /tmp/reinstall-os-threatpatrols
nohup pkg install --force --yes os-threatpatrols 1> /dev/null 2> /dev/null &
fi
fi
else
rm -f /tmp/reinstall-os-threatpatrols
fi