Compare commits

..

No commits in common. "0716ee08a621ed61c218b7a092925ba976d37c98" and "1cb81284c97abdeabc092deaaff30992a3c7e0ee" have entirely different histories.

7 changed files with 41 additions and 54 deletions

View File

@ -40,8 +40,6 @@ copy_files() {
cp wmde-rp-full.prf /etc
cp wmde-rp-config.prf /etc
cp wmde-rp-perm.prf /etc
cp wmde-rp.conf /etc
}
update_pam() {

View File

@ -1,18 +1,10 @@
ignore=Name *
ignorenot=Path .config
ignorenot=Path .local/share/backgrounds"
ignorenot=Path .thunderbird
ignorenot=Path .mozilla
ignore = Path Local
ignore = Name .cache
ignore = Name .cache2
ignore = Path .thunderbird/*/ImapMail
ignore = Path .thunderbird/*/Mail
ignore = Path .mozilla/firefox/*/storage
ignore = Path .mozilla/firefox/*/lock
ignore = Path snap/firefox/common/.mozilla/firefox/*/storage
ignore = Path .config/goa-1.0/accounts.conf
ignore = Path .config/sipgate-softphone/Cache
ignorenot=Name *.kdbx
ignorenot=Path ./cache/keepassxc
ignore = Path Local

View File

@ -2,8 +2,9 @@ ignore = Path Local
ignore = Name .cache
ignore = Name .cache2
ignore = Path .thunderbird/*/ImapMail
ignore = Path .mozilla/firefox/*/storage
ignore = Path .mozilla/firefox/*/lock
ignore = Path snap/firefox/common/.mozilla/firefox/*/storage
ignore = Path .config/goa-1.0/accounts.conf
ignore = Path .config/sipgate-softphone/Cache
ignore = Path Downloads

View File

@ -12,9 +12,11 @@ cd /tmp
. $PREFIX/wmde-rp-check-pam-user.sh #exit if user does not belong to rp criteria
#echo "WMDE Roaming Profile"
export HOMEDIR=$(getent passwd "$PAM_USER" | cut -d: -f6)
export WMDE_UNISONARGS="-auto -log -prefer newer -batch"
export UNISON=$HOMEDIR/.unison-wmde
export PAM_USER=$PAM_USER
export SSHARGS="-o UserKnownHostsFile=$HOMEDIR/.wmdesync/known_hosts"
@ -25,39 +27,39 @@ export SSHARGS="-o UserKnownHostsFile=$HOMEDIR/.wmdesync/known_hosts"
TIMEOUT=30
echo "WAIT_FOR_FULLSYNC=$WAIT_FOR_FULLSYNC" >> /tmp/wtforsyc.txt
echo "WAIT_FOR_CONFIGC=$WAIT_FOR_CONFIG" >> /tmp/wtforsyc.txt
if [ "$WAIT_FOR_CONFIG" = "never" ] && [ "$WAIT_FOR_FULLSYNC" = "never" ] ; then
echo "Both, WAIT_FOR_CONFIG and WAIT_FOR_FULLSYNC are never - exit 0" >> /tmp/wtforsyc.txt
exit 0
fi
#if [ -f "$FIFULLSYNC" ]; then
# exit 0
#fi
if [ ! -f "$FIRSTSYNC" ]; then
FIRSTRUN="first"
echo "File $FIRSTSYNC does not exists, setting FIRSTRUN=$FIRSTRUN." >> /tmp/wtforsyc.txt
else
FIRSTRUN="no"
echo "File $FIRSTSYNC found, setting FIRSTRUN=$FIRSTRUN." >> /tmp/wtforsyc.txt
fi
echo "FIRST $FIRSTRUN" >> /tmp/wtforsyc.txt
if [ "$WAIT_FOR_CONFIG" = "never" ] && [ "$WAIT_FOR_FULLSYNC" = "never" ] && [ "$WAIT_FOR_SMALLFILESSYNC" = "never" ]; then
exit 0
fi
# wait for pid file to be created (max 30 seconds)
i=0
while [ $i -lt $TIMEOUT ]; do
if [ -f "$PIDFILE" ]; then
PID=`cat $PIDFILE`
echo "Found pid file $PIDFILEE with content: $PID" >> /tmp/wtforsyc.txt
if kill -0 "$PID" 2>/dev/null; then
break
fi
echo "WAITING FOR PIDFILE $i" >> /tmp/wtforsyc.txt
if [ -f "$PIDFILE" ]; then
echo "FOUND PID FILE" >> /tmp/wtforsyc.txt
PID=`cat $PIDFILE`
if kill -0 "$PID" 2>/dev/null; then
break
fi
echo "No pid file $PIDFILE found, waiting sice $seconds" >> /tmp/wtforsyc.txt
sleep 1
i=$((i + 1))
fi
sleep 1
i=$((i + 1))
done
if [ $i -eq $TIMEOUT ]; then
echo "NO PIDFILE - ERROR" >> /tmp/wtforsyc.txt
@ -88,9 +90,16 @@ wait_for_sync() {
if [ "$WAIT_FOR_CONFIG" = "always" ] || [ "$WAIT_FOR_CONFIG" = "$FIRSTRUN" ]; then
echo "Wait for Config" >> /tmp/wtforsyc.txt
wait_for_sync $HOMEDIR/ $CONFIGSYNC "Loading config:" ""
wait_for_sync $HOMEDIR/.config $CONFIGSYNC "Loading config:" ""
fi
if [ "$WAIT_FOR_SMALLFILESSYNC" = "always" ] || [ "$WAIT_FOR_SMALLFILESSYNC" = "$FIRSTRUN" ]; then
echo "Wait for Small files" >> /tmp/wtforsyc.txt
wait_for_sync $HOMEDIR $SMALLFILESSYNC "Loading small files:" ""
fi
if [ "$WAIT_FOR_FULLSYNC" = "always" ] || [ "$WAIT_FOR_FULLSYNC" = "$FIRSTRUN" ]; then

View File

@ -1,9 +0,0 @@
ignore = Path Local
ignore = Name .cache
ignore = Name .cache2
ignore = Path .thunderbird/*/ImapMail
ignore = Path .mozilla/firefox/*/lock
ignore = Path snap/firefox/common/.mozilla/firefox/*/storage
ignore = Path .config/goa-1.0/accounts.conf
ignore = Path .config/sipgate-softphone/Cache

View File

@ -85,13 +85,12 @@ fi
IGNORES="-ignore 'Path .wmdesync'"
OTHERARGS="-auto -log -prefer newer -maxerrors 500000 -fastcheck true"
OTHERARGS="-auto -log -prefer newer -maxerrors 500000 -fastcheck"
export UNISONLOCALHOSTNAME=`hostname`
export UNISON=$HOMEDIR/.wmdesync/unison-$UNISONLOCALHOSTNAME
WMDE_UNISON_PRF=/etc/wmde-rp-full.prf
WMDE_UNISON_CFG_PRF=/etc/wmde-rp-config.prf
WMDE_UNISON_PERM_PRF=/etc/wmde-rp-perm.prf
SERVERCMD="UNISONLOCALHOSTNAME=$UNISONLOCALHOSTNAME UNISON=$UNISON unison"
@ -157,7 +156,6 @@ generate_profile() {
generate_profile full
generate_profile config
generate_profile perm
#cp "$WMDE_UNISON_PRF" "$UNISON/full.prf";
#cp "$WMDE_UNISON_CFG_PRF" "$UNISON/config.prf";
@ -165,17 +163,15 @@ generate_profile perm
# Sync config
#for item in $CONFIGDIRS; do
# CONFIGDIRSARGS="$CONFIGDIRSARGS -path $item"
#done
for item in $CONFIGDIRS; do
CONFIGDIRSARGS="$CONFIGDIRSARGS -path $item"
done
yes | unison config -times -sshargs "$SSHARGS" -servercmd "$SERVERCMD" $OTHERARGS -batch -ignore 'Path .wmdesync'
echo "PUT PID INTO CONFIG_SYNC"
unison config -times -sshargs "$SSHARGS" -servercmd "$SERVERCMD" $OTHERARGS -batch -ignore 'Path .wmdesync' $CONFIGDIRSARGS
echo "$$" > $CONFIGSYNC
echo "DONE PUT PID INTO CONFIG_SYNC"
echo "$$" > $SMALLFILESSYNC
# Sync all
yes | unison full -times -sshargs "$SSHARGS" -servercmd "$SERVERCMD" $OTHERARGS -batch -ignore 'Path .wmdesync'
@ -183,7 +179,7 @@ echo "$$" > $FULLSYNC
echo "$$" > $FIRSTSYNC
# Sync all & repeat
yes | unison perm -times -sshargs "$SSHARGS" -servercmd "$SERVERCMD" $OTHERARGS -batch -ignore 'Path .wmdesync' -repeat watch+60
yes | unison full -times -sshargs "$SSHARGS" -servercmd "$SERVERCMD" $OTHERARGS -batch -ignore 'Path .wmdesync' -repeat watch+60
exit 0

View File

@ -13,12 +13,12 @@ NETGROUPS="wmde-rp-general"
WAIT_FOR_CONFIG=always # always, first or never
WAIT_FOR_SMALLFILESSYNC=first # always, first or never
WAIT_FOR_FULLSYNC=never # always, first or never
CONFIGDIRS=".config \
.local/share/backgrounds \
.ssh"
.local/share/backgrounds"
SMALLFILESSIZE=1024