{
writeShellApplication,
rclone,
matrix-commander-rs,
libnotify,
...
}:
writeShellApplication {
name = "custom-checkKdrive";
runtimeInputs = [
rclone
matrix-commander-rs
libnotify
];
text = ''
set +e
output=$(rclone lsd kdrive: 2>&1)
status=$?
set -e
if [ $status -eq 0 ]; then
echo "kdrive OK"
else
echo "kdrive rclone failed with error: $output"
notify-send "rclone kdrive failed" "$output"
matrix-commander-rs --verbose -m "rclone kdrive failed.
Error:
$output