mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
commit
3bbfd1dbeb
24 changed files with 82 additions and 90 deletions
|
@ -1,5 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
backup_dir="$1/ldap"
|
||||
mkdir -p $backup_dir
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
backup_dir="$1/ssh"
|
||||
mkdir -p $backup_dir
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
backup_dir="$1/mysql"
|
||||
mkdir -p $backup_dir
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
backup_dir="$1/ssowat"
|
||||
mkdir -p $backup_dir
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
backup_dir="$1/home"
|
||||
mkdir -p $backup_dir
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
backup_dir="$1/yunohost"
|
||||
mkdir -p $backup_dir
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
backup_dir="$1/mail"
|
||||
|
||||
sudo cp -a /var/mail/. $backup_dir
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
backup_dir="$1/xmpp"
|
||||
mkdir -p $backup_dir/{etc,var}
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
backup_dir="$1/nginx"
|
||||
mkdir -p $backup_dir
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
backup_dir="$1/cron"
|
||||
mkdir -p $backup_dir
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
backup_dir="$1/ldap"
|
||||
|
||||
if [ -z "$2" ]; then
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
backup_dir="$1/ssh"
|
||||
|
||||
sudo cp -a $backup_dir/. /etc/ssh
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
backup_dir="$1/mysql"
|
||||
|
||||
mysqlpwd=$(sudo cat /etc/yunohost/mysql)
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
backup_dir="$1/ssowat"
|
||||
|
||||
sudo cp -a $backup_dir/. /etc/ssowat
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
backup_dir="$1/home"
|
||||
|
||||
sudo cp -a $backup_dir/. /home
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
backup_dir="$1/yunohost"
|
||||
|
||||
sudo cp -a $backup_dir/. /etc/yunohost
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
backup_dir="$1/mail"
|
||||
|
||||
sudo cp -a $backup_dir/. /var/mail
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
backup_dir="$1/xmpp"
|
||||
|
||||
sudo cp -a $backup_dir/etc/. /etc/metronome
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
backup_dir="$1/nginx"
|
||||
|
||||
sudo cp -a $backup_dir/. /etc/nginx/conf.d
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
backup_dir="$1/cron"
|
||||
|
||||
sudo cp -a $backup_dir/. /etc/cron.d
|
||||
|
|
96
debian/postinst
vendored
96
debian/postinst
vendored
|
@ -1,56 +1,86 @@
|
|||
#!/bin/bash
|
||||
|
||||
TMP=/usr/share/yunohost/yunohost-config/moulinette
|
||||
set -e
|
||||
|
||||
if [ ! -d /etc/yunohost ];
|
||||
then
|
||||
do_configure() {
|
||||
TMP=/usr/share/yunohost/yunohost-config/moulinette
|
||||
|
||||
if [ ! -d /etc/yunohost ];
|
||||
then
|
||||
mkdir -p /etc/yunohost
|
||||
fi
|
||||
fi
|
||||
|
||||
# Allow users to access /media directory
|
||||
if [ ! -d /etc/skel/media ];
|
||||
then
|
||||
# Allow users to access /media directory
|
||||
if [ ! -d /etc/skel/media ];
|
||||
then
|
||||
mkdir -p /media
|
||||
ln -s /media /etc/skel/
|
||||
fi
|
||||
fi
|
||||
|
||||
#Firewall
|
||||
grep -q "UPNP:" /etc/yunohost/firewall.yml > /dev/null 2>&1
|
||||
if [[ $? -eq 0 ]] || [ ! -f /etc/yunohost/firewall.yml ];
|
||||
then
|
||||
#Firewall
|
||||
grep -q "UPNP:" /etc/yunohost/firewall.yml > /dev/null 2>&1
|
||||
if [[ $? -eq 0 ]] || [ ! -f /etc/yunohost/firewall.yml ];
|
||||
then
|
||||
cp $TMP/firewall.yml /etc/yunohost/
|
||||
fi
|
||||
fi
|
||||
|
||||
# App fetchlist
|
||||
if [ -f /etc/cron.d/yunohost-applist-yunohost ];
|
||||
then
|
||||
# App fetchlist
|
||||
if [ -f /etc/cron.d/yunohost-applist-yunohost ];
|
||||
then
|
||||
sed -i "s/--no-ldap //g" /etc/cron.d/yunohost-applist-yunohost
|
||||
fi
|
||||
fi
|
||||
|
||||
# Service list
|
||||
if [ ! -f /etc/yunohost/services.yml ];
|
||||
then
|
||||
# Service list
|
||||
if [ ! -f /etc/yunohost/services.yml ];
|
||||
then
|
||||
cp $TMP/services.yml /etc/yunohost/
|
||||
fi
|
||||
fi
|
||||
|
||||
# Stop old API
|
||||
ps aux | grep "yunohost.tac" | grep -qv grep
|
||||
if [[ $? -eq 0 ]];
|
||||
then
|
||||
# Stop old API
|
||||
ps aux | grep "yunohost.tac" | grep -qv grep
|
||||
if [[ $? -eq 0 ]];
|
||||
then
|
||||
killall twistd
|
||||
fi
|
||||
fi
|
||||
|
||||
rm -rf /var/cache/moulinette/*
|
||||
update-rc.d yunohost-api defaults
|
||||
service yunohost-api restart
|
||||
rm -rf /var/cache/moulinette/*
|
||||
update-rc.d yunohost-api defaults > /dev/null
|
||||
service yunohost-api restart
|
||||
|
||||
# Reload SSOwat conf if obsolete
|
||||
if [ -f /etc/yunohost/installed ];
|
||||
then
|
||||
# Firewall
|
||||
update-rc.d yunohost-firewall defaults > /dev/null
|
||||
|
||||
# Reload SSOwat conf if obsolete
|
||||
if [ -f /etc/yunohost/installed ];
|
||||
then
|
||||
yunohost firewall upnp | grep -qi "true"
|
||||
if [[ $? -eq 0 ]];
|
||||
then
|
||||
yunohost firewall upnp enable
|
||||
fi
|
||||
yunohost app ssowatconf
|
||||
fi
|
||||
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
|
||||
|
|
5
debian/yunohost-api.init
vendored
5
debian/yunohost-api.init
vendored
|
@ -6,6 +6,7 @@
|
|||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Start/stop YunoHost API
|
||||
# Description: Start/stop YunoHost API
|
||||
### END INIT INFO
|
||||
|
||||
DAEMON=/usr/bin/yunohost-api
|
||||
|
@ -40,7 +41,7 @@ case "$1" in
|
|||
kill `ps aux | grep 'yunohost-api' | grep -v grep | grep -v stop | awk '{print $2}'` > /dev/null 2>&1
|
||||
log_end_msg 0
|
||||
;;
|
||||
restart)
|
||||
restart|force-reload)
|
||||
logger "YunoHost API: Restarting"
|
||||
log_daemon_msg "Restarting API: YunoHost"
|
||||
if [ -f /var/run/yunohost-api.pid ]; then
|
||||
|
@ -66,7 +67,7 @@ case "$1" in
|
|||
;;
|
||||
*)
|
||||
logger "YunoHost API: Invalid usage"
|
||||
echo "Usage: /etc/init.d/yunohost-api {start|stop|restart|status}" >&2
|
||||
echo "Usage: /etc/init.d/yunohost-api {start|stop|restart|force-reload|status}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
|
5
debian/yunohost-firewall.init
vendored
5
debian/yunohost-firewall.init
vendored
|
@ -6,6 +6,7 @@
|
|||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Start/stop YunoHost firewall
|
||||
# Description: Start/stop YunoHost firewall
|
||||
### END INIT INFO
|
||||
|
||||
DAEMON=/usr/bin/yunohost
|
||||
|
@ -30,7 +31,7 @@ case "$1" in
|
|||
/usr/bin/yunohost firewall stop
|
||||
log_end_msg $?
|
||||
;;
|
||||
restart)
|
||||
restart|force-reload)
|
||||
logger "YunoHost firewall: Restarting"
|
||||
log_daemon_msg "Restarting firewall: YunoHost"
|
||||
/usr/bin/yunohost firewall reload
|
||||
|
@ -44,7 +45,7 @@ case "$1" in
|
|||
;;
|
||||
*)
|
||||
logger "YunoHost API: Invalid usage"
|
||||
echo "Usage: /etc/init.d/yunohost-api {start|stop|restart|status}" >&2
|
||||
echo "Usage: /etc/init.d/yunohost-api {start|stop|restart|force-reload|status}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
|
0
lib/yunohost/__init__.py
Executable file → Normal file
0
lib/yunohost/__init__.py
Executable file → Normal file
Loading…
Add table
Reference in a new issue