File .sh does not run on domain users

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
ruyzz

File .sh does not run on domain users

Post by ruyzz »

I want to block applications on the desktop and I have the following:

Code: Select all

#! / bin / bash

chattr + i /home/domain/*/Desktop/*.desktop
But in /etc/init.d/ex.sh

The following are not executed on domain users:

Code: Select all

chmod a + x /etc/init.d/ex.sh
update-rc.d ex.sh defaults
If I run when the users are created, there are no problems

Code: Select all

sudo bash ex.sh
But when new ones are added, init.d does not work.

Please help me!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
Fred Barclay
Level 12
Level 12
Posts: 4185
Joined: Sat Sep 13, 2014 11:12 am
Location: USA primarily

Re: File .sh does not run on domain users

Post by Fred Barclay »

I've never seen this before so this may be wrong, but one thing that needs fixing in the script is removing the spaces in the first line.
It should look like #!/bin/bash

Hope this helps!
Fred
Image
"Once you can accept the universe as matter expanding into nothing that is something, wearing stripes with plaid comes easy."
- Albert Einstein
ruyzz

Re: File .sh does not run on domain users

Post by ruyzz »

It was a copy paste, maybe not executed due to restrictions of restricted users!
Locked

Return to “Scripts & Bash”