6
ufwd
6
ufwd
@@ -22,13 +22,11 @@ usage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
upload() {
|
upload() {
|
||||||
declare file=$1
|
declare file=$1; shift
|
||||||
|
|
||||||
upload_output=$( ufw -R "$@" "$file" )
|
upload_output=$( ufw -R "$@" "$file" )
|
||||||
upload_return=$?
|
upload_return=$?
|
||||||
|
|
||||||
echo "ufw $* -R $file"
|
|
||||||
|
|
||||||
if (( flag_enable_notifications )); then
|
if (( flag_enable_notifications )); then
|
||||||
if (( $upload_return )); then
|
if (( $upload_return )); then
|
||||||
notify-send 'ufwd' "File upload failed: $upload_output"
|
notify-send 'ufwd' "File upload failed: $upload_output"
|
||||||
@@ -82,7 +80,7 @@ main() {
|
|||||||
cd "$cfg_workdir" || return 1
|
cd "$cfg_workdir" || return 1
|
||||||
|
|
||||||
while read -r dir action path; do
|
while read -r dir action path; do
|
||||||
upload "$dir$path" &
|
upload "$dir$path" "$@" &
|
||||||
done < <( inotifywait -m -e create "$cfg_workdir" )
|
done < <( inotifywait -m -e create "$cfg_workdir" )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user