I was going to say that you should use "install -o landscape -d $DATA_PATH" instead of the separate mkdir; chown. But then I realised that all we're trying to do is make a file in a directory, so we should be using "install -D -o landscape user-update-flag $DATA_PATH/user-update-flag" and drop the test for directory existence and all the chowns
Check the man page for install if you're not aware of it, it's used extensively in debian packages to avoid just these kinds of bugs :)
I was going to say that you should use "install -o landscape -d $DATA_PATH" instead of the separate mkdir; chown. But then I realised that all we're trying to do is make a file in a directory, so we should be using "install -D -o landscape user-update-flag $DATA_PATH/ user-update- flag" and drop the test for directory existence and all the chowns
Check the man page for install if you're not aware of it, it's used extensively in debian packages to avoid just these kinds of bugs :)