mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[enh] postinst : only respond to configure
This commit is contained in:
parent
659b3126cc
commit
17e4872a98
1 changed files with 75 additions and 46 deletions
121
debian/postinst
vendored
121
debian/postinst
vendored
|
@ -1,56 +1,85 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
#!/bin/sh
|
||||||
|
# postinst script for yunohost-config-metronome
|
||||||
|
|
||||||
TMP=/usr/share/yunohost/yunohost-config/moulinette
|
set -e
|
||||||
|
|
||||||
if [ ! -d /etc/yunohost ];
|
do_configure() {
|
||||||
then
|
TMP=/usr/share/yunohost/yunohost-config/moulinette
|
||||||
mkdir -p /etc/yunohost
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Allow users to access /media directory
|
if [ ! -d /etc/yunohost ];
|
||||||
if [ ! -d /etc/skel/media ];
|
then
|
||||||
then
|
mkdir -p /etc/yunohost
|
||||||
mkdir -p /media
|
fi
|
||||||
ln -s /media /etc/skel/
|
|
||||||
fi
|
|
||||||
|
|
||||||
#Firewall
|
# Allow users to access /media directory
|
||||||
grep -q "UPNP:" /etc/yunohost/firewall.yml > /dev/null 2>&1
|
if [ ! -d /etc/skel/media ];
|
||||||
if [[ $? -eq 0 ]] || [ ! -f /etc/yunohost/firewall.yml ];
|
then
|
||||||
then
|
mkdir -p /media
|
||||||
cp $TMP/firewall.yml /etc/yunohost/
|
ln -s /media /etc/skel/
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# App fetchlist
|
#Firewall
|
||||||
if [ -f /etc/cron.d/yunohost-applist-yunohost ];
|
grep -q "UPNP:" /etc/yunohost/firewall.yml > /dev/null 2>&1
|
||||||
then
|
if [[ $? -eq 0 ]] || [ ! -f /etc/yunohost/firewall.yml ];
|
||||||
sed -i "s/--no-ldap //g" /etc/cron.d/yunohost-applist-yunohost
|
then
|
||||||
fi
|
cp $TMP/firewall.yml /etc/yunohost/
|
||||||
|
fi
|
||||||
|
|
||||||
# Service list
|
# App fetchlist
|
||||||
if [ ! -f /etc/yunohost/services.yml ];
|
if [ -f /etc/cron.d/yunohost-applist-yunohost ];
|
||||||
then
|
then
|
||||||
cp $TMP/services.yml /etc/yunohost/
|
sed -i "s/--no-ldap //g" /etc/cron.d/yunohost-applist-yunohost
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Stop old API
|
# Service list
|
||||||
ps aux | grep "yunohost.tac" | grep -qv grep
|
if [ ! -f /etc/yunohost/services.yml ];
|
||||||
if [[ $? -eq 0 ]];
|
then
|
||||||
then
|
cp $TMP/services.yml /etc/yunohost/
|
||||||
killall twistd
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
rm -rf /var/cache/moulinette/*
|
# Stop old API
|
||||||
update-rc.d yunohost-api defaults
|
ps aux | grep "yunohost.tac" | grep -qv grep
|
||||||
service yunohost-api restart
|
if [[ $? -eq 0 ]];
|
||||||
|
then
|
||||||
|
killall twistd
|
||||||
|
fi
|
||||||
|
|
||||||
# Reload SSOwat conf if obsolete
|
rm -rf /var/cache/moulinette/*
|
||||||
if [ -f /etc/yunohost/installed ];
|
update-rc.d yunohost-api defaults
|
||||||
then
|
service yunohost-api restart
|
||||||
yunohost firewall upnp | grep -qi "true"
|
|
||||||
if [[ $? -eq 0 ]];
|
# Reload SSOwat conf if obsolete
|
||||||
then
|
if [ -f /etc/yunohost/installed ];
|
||||||
yunohost firewall upnp enable
|
then
|
||||||
fi
|
yunohost firewall upnp | grep -qi "true"
|
||||||
yunohost app ssowatconf
|
if [[ $? -eq 0 ]];
|
||||||
fi
|
then
|
||||||
|
yunohost firewall upnp enable
|
||||||
|
fi
|
||||||
|
yunohost app ssowatconf
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# summary of how this script can be called:
|
||||||
|
# * <postinst> `configure' <most-recently-configured-version>
|
||||||
|
# * <old-postinst> `abort-upgrade' <new version>
|
||||||
|
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
|
||||||
|
# <new-version>
|
||||||
|
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
|
||||||
|
# <failed-install-package> <version> `removing'
|
||||||
|
# <conflicting-package> <version>
|
||||||
|
# for details, see http://www.debian.org/doc/debian-policy/ or
|
||||||
|
# the debian-policy package
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
configure)
|
||||||
|
do_configure
|
||||||
|
;;
|
||||||
|
abort-upgrade|abort-remove|abort-deconfigure)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "postinst called with unknown argument \`$1'" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
Loading…
Add table
Reference in a new issue