The Bash-Sh script at boot time cannot access user folders

First of all, I'm a newbie to Linux and scripts.

I have a problem with a sh script that runs when I start Raspbian.

The script needs to access the home folder.

If I start it from my session, no problem, everything works fine.

If I set it to start at boot, it doesn't work and I have it in logs

Apr  4 13:43:28 RPI-SEEDBOX openvpn[588]: /etc/openvpn/waitfinal.sh: 19: /etc/openvpn/waitfinal.sh: cannot create /home/pi/.config/qBittorrent/test.conf: Directory nonexistent

After searching, I understood that the home folder will not be mounted if the session is not open.
Is there any way to access the home folder through the sh script during startup?

For your information, the script is run as part of the OpenVPN startup process
Openvpn is started as a service.

Thank you for your help and sorry if I don't explain it very well. I don't have all the technical words.

applescript – Can I handle opening the Apple event in a bash shell script using the osascript command?

I use a bash script (myJavaBash.sh) in an application package (myJavaJar.app) that starts "java -jar myJarFile.jar" with additional JVM arguments (which has worked so far). My goal is to give the file a file name as an argument even if the user opens a file using "Open with … myJavaJar.app".

I tried to implement OpenFilesHandler in the Java application and copy an AppleScript scpt file into the bundle that myJavaBash.sh calls without success.

The last thing I tried to test every possibility was to call Osascript within bash

#!/bin/bash

#test: set command line args
MY_TITLE="Launching myJavaJarApp"
ARGS_MSG="command line args: "

osascript <<-EndOfScript
    set arguments to ""
      on open theFiles
            repeat with anItem in theFiles
               set arguments to arguments & space & (quoted form of POSIX path of anItem)
            end repeat
      end open
    display dialog "$ARGS_MSG" & arguments with title "$MY_TITLE"     
EndOfScript

Did not work, the dialog only gives $ ARGS_MSG and no arguments when I open a file with myJavaJar.app.

It seems to me that setting the bash script as CFBundleExecutable "consumes" all AppleEvents.

Or is there a way?

Google Sheets – App Script to Random Range with 10% of the total data

I have a table with 20 rows of data.
I want to randomize the data to 10% of the total data.
The script I made is as follows:

function shuffleSheet() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getActiveSheet();
  var range = sheet.getRange('A2:D21');
  range.setValues(shuffleArray(range.getValues()));    
}    

function shuffleArray(array) {
  var i, j, temp;
  for (i = array.length - 1; i > 0; i--) {
    j = Math.floor(Math.random() * (i + 1));
    temp = array(i);
    array(i) = array(j);
    array(j) = temp;
  }
  return array;
}

After I run the script, the data is randomized all the data.
Enter the image description here

The result of what I want can see it below:
Enter the image description here

linux – Trust the GPG key via script

With an automated server deployment, I can upload and import GPG keys using a script. But I can't trust keys.

I tried

gpg --batch --yes --edit-key keyname trust 5

and

echo 5 | gpg --batch --yes --edit-key keyname trust -

In non-batch mode, there is always a stop to ask for input. In batch mode, entries are ignored.

What is the correct syntax?

macos – bash script to delete files revived by Adobe InDesign error

After an update in March, Adobe Indesign will revive remote directories for which it was originally responsible, but no files other than a file named "AdobeFnt.lst". So where you used to have a complex folder structure, but then deleted it, you now have the whole structure again, but somewhere a folder contains AdobeFnt.lst (and since it is MacOS, possibly some .DS_Store files). My mother complained and I offered to write her a script that would search for these revived empty directories every minute. I wrote what is below in addition to their crontab, but am afraid to erase things incorrectly.

Would this make the job safe? She saves these InDesign packages on her desktop, and I wanted to tell her to put all of the folders in which she stores content into the DIRS array above.

#!/bin/bash

# List where you save InDesign packages
DIRS=(
    "$HOME/Desktop"
)


IFS=$'n'
for DIR in "${DIRS(@)}"; do
    DS=($(find "$DIR" -type d -maxdepth 1 -mindepth 1))
    for D in "${DS(@)}"; do
        FS=($(find "$D" -type f ! -iname .DS_Store))
        if ( ${#FS(@)} -eq 1 ) && ( $(basename "${FS(0)}") = "AdobeFnt.lst" ); then
            echo "Removing $D"
            rm -r $D 
        fi
    done
done
```

Google Apps – How to link a script I created in my PC browser to make it work

I did a script, thanks to Tedinoz here.

I have now also created a draw button and added the script

This button appears in my mobile app, but when I press it, I can only delete it so the script doesn't run. There is a way to link for the button to work in my mobile app (no mobile browser?

My working script from the PC browser and the button as it appears in the mobile app are in the screenshot

Enter the image description here

Google Sheets – How to link a script I created in my PC browser to my mobile app

I did a script, thanks to Tedinoz here.

I have now also created a draw button and added the script

This button appears in my mobile app, but when I press it, I can only delete it so the script doesn't run. There is a way to link for the button to work in my mobile app (no mobile browser?

My working script from the PC browser and the button as it appears in the mobile app are in the screenshot

Enter the image description here

Count when in google script

How do you calculate the number of occurrences of products in order from top to bottom (column C)?
How is it possible to write a simple script to know the B column?

https://docs.google.com/spreadsheets/d/1YTOA-VLjupiwcESfYTl_32iR2fFY1iBO5on8t27WvTg/edit#gid=0

google docs – script to get the time zone of the user

So my request is as follows. I am using Google Docs for a group of friends in a game and I want to add a script function to an image of a button that is given when the user clicks and grants access to the published sheet with editing rights. fills a preselected cell with the time zone gmt or UTC and not with the preselected settings for the spreadsheet settings. Is there such a script or method that uses it?