shell – Can’t install apk using sh script and init.d app

I’m trying to install apk when the device is booting.
I wrote shell script to install apk:

#!/system/bin/sh
pm install /data/local/tmp/WP8_pro_SSUI_Settings_hebrew2.apk

Unfortunately, when I enters the shell (using ‘adb shell’) and runs the script(using ‘sh my_script.sh’)
I get error:

Exception occurred while executing:
java.lang.IllegalArgumentException: Error: Can't open file: /data/local/tmp/MagiskManager-v7.1.1.apk
        at com.android.server.pm.PackageManagerShellCommand.setParamsSize(PackageManagerShellCommand.java:461)
        at com.android.server.pm.PackageManagerShellCommand.runInstall(PackageManagerShellCommand.java:1060)
        at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:169)
        at android.os.ShellCommand.exec(ShellCommand.java:111)
        at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:22472)
        at android.os.Binder.shellCommand(Binder.java:881)
        at android.os.Binder.onTransact(Binder.java:765)
        at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4924)
        at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4118)
        at android.os.Binder.execTransactInternal(Binder.java:1021)
        at android.os.Binder.execTransact(Binder.java:994)

I already tried to put the apk in /data/local/tmp but it’s not working.
Also init.d app failed to run the script