2 # Copyright 1999-2012 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
5 description="Webbrowser profile syncing"
7 PIDFILE=/var/run/${SVCNAME}.pid
9 [ -e /etc/psd.conf ] && . /etc/psd.conf
12 ebegin "Starting Profile-Sync-Daemon"
13 if [[ -z $USERS ]]; then
14 eerror "Define at least one user in /etc/psd.conf"
19 homedir=$(su -c 'echo $HOME' $i)
20 if [[ ! -d $homedir ]]; then
21 eerror "Invalid user defined in /etc/psd.conf"
26 /usr/bin/profile-sync-daemon check
27 start-stop-daemon --start --pidfile ${PIDFILE} --make-pidfile --background \
28 --exec /usr/bin/profile-sync-daemon -- sync
33 ebegin "Stopping Profile-Sync-Daemon"
34 if [[ ! -f $PIDFILE ]]; then
35 eerror "Profile-Sync-Daemon is not running, nothing to stop!"
38 /usr/bin/profile-sync-daemon sync && /usr/bin/profile-sync-daemon unsync
45 ebegin "Syncing browser profiles in tmpfs to physical disc"
46 if [[ ! -f $PIDFILE ]]; then
47 eerror "Profile-Sync-Daemon is not running... cannot sync!"
50 /usr/bin/profile-sync-daemon sync