k 3 fetchWallpaper: change predicate handling

a failed predicate does not result in a failed system service
it will just not download the remote
This commit is contained in:
makefu 2015-12-13 13:50:39 +01:00
parent c0786aee72
commit 1c17881aed

View file

@ -37,11 +37,10 @@ let
fetchWallpaperScript = pkgs.writeScript "fetchWallpaper" ''
#! ${pkgs.bash}/bin/bash
${if (cfg.predicate == null) then "" else ''
${cfg.predicate}
if [ $? -ne 0 ]; then
echo "predicate failed"
exit 23
${optionalString (cfg.predicate != null) ''
if ! ${cfg.predicate}; then
echo "predicate failed - will not fetch from remote"
exit 0
fi
''}
mkdir -p ${shell.escape cfg.stateDir}