File .sh does not run on domain users

Forum rules
Before you post please read how to get help
Post Reply
ruyzz
Level 1
Level 1
Posts: 18
Joined: Sat Feb 24, 2018 11:01 pm

File .sh does not run on domain users

Post by ruyzz » Wed May 02, 2018 2:43 pm

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!

User avatar
Fred Barclay
Level 12
Level 12
Posts: 4152
Joined: Sat Sep 13, 2014 11:12 am
Location: Bumping around in the bush

Re: File .sh does not run on domain users

Post by Fred Barclay » Fri May 04, 2018 5:27 pm

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
Level 1
Level 1
Posts: 18
Joined: Sat Feb 24, 2018 11:01 pm

Re: File .sh does not run on domain users

Post by ruyzz » Fri May 04, 2018 10:03 pm

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

Post Reply

Return to “Scripts & Bash”