summaryrefslogtreecommitdiff
path: root/pcr/yacy/yacy.install
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-03-28 04:47:55 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-03-28 04:47:55 -0300
commitff729803bb49198248d8a72931e9c5dee3cca67a (patch)
tree5a2804c3212a435c3679729fc7fd5cab5c800a55 /pcr/yacy/yacy.install
parentdee18d3b579f4bc4b949651389e1d96250e543fc (diff)
downloadabslibre-ff729803bb49198248d8a72931e9c5dee3cca67a.tar.gz
abslibre-ff729803bb49198248d8a72931e9c5dee3cca67a.tar.bz2
abslibre-ff729803bb49198248d8a72931e9c5dee3cca67a.zip
yacy: add new package to [pcr]
Diffstat (limited to 'pcr/yacy/yacy.install')
-rw-r--r--pcr/yacy/yacy.install37
1 files changed, 37 insertions, 0 deletions
diff --git a/pcr/yacy/yacy.install b/pcr/yacy/yacy.install
new file mode 100644
index 000000000..dbd350d17
--- /dev/null
+++ b/pcr/yacy/yacy.install
@@ -0,0 +1,37 @@
+post_install() {
+ echo
+ echo -n ">>> Creating yacy system user and group... "
+ getent group yacy &>/dev/null || groupadd -r yacy
+ getent passwd yacy &>/dev/null || /usr/sbin/useradd --comment 'YaCy P2P Searchengine' --system -g yacy --home '/usr/share/yacy/' -s /bin/false yacy
+ mkdir -p /var/lib/yacy
+ chown -R yacy:yacy /var/lib/yacy /opt/yacy
+ rm -f /usr/share/yacy/DATA
+ ln -s /var/lib/yacy /usr/share/yacy/DATA
+ echo "done"
+ echo
+}
+
+post_upgrade() {
+ chown -R yacy:yacy /var/lib/yacy /opt/yacy
+ systemctl --system daemon-reload
+}
+
+pre_remove() {
+ echo
+ echo -n ">>> Removing yacy system user and group... "
+ getent passwd yacy &>/dev/null &&
+ /usr/sbin/userdel yacy &>/dev/null
+ getent group yacy &>/dev/null &&
+ groupdel yacy &>/dev/null
+ rm -f /usr/share/yacy/DATA
+ echo "done"
+ echo
+}
+
+post_remove() {
+ echo
+ echo "-> All configfiles and the cache are in /var/lib/yacy/"
+ echo "-> You may use this for another installation."
+ echo "-> If you don't need it, you should delete it, because"
+ echo "-> it may have grown very large"
+}