[Solved] The domain user usually deletes applications accidentally in the desktop!

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

[Solved] The domain user usually deletes applications accidentally in the desktop!

Post by ruyzz » Wed May 02, 2018 12:33 am

Hello

I want to block applications .desktop, the domain user usually deletes applications accidentally.

It can be done manually with the terminal Ctrl + Alt + T:

Chttr + i /home/domain/user/desktop/*.desktop

But the PC, is used by "n" users.

Is there any way to do it automatically with an .sh file?

Greetings.
Last edited by ruyzz on Fri May 04, 2018 6:32 pm, edited 1 time in total.

User avatar
catweazel
Level 17
Level 17
Posts: 7067
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: The domain user usually deletes applications accidentally in the desktop!

Post by catweazel » Wed May 02, 2018 1:56 am

ruyzz wrote:
Wed May 02, 2018 12:33 am
Is there any way to do it automatically with an .sh file?
You can try adding the command to rc.local.

Code: Select all

sudo nano /etc/rc.local
Add the command in there before the line that reads exit 0.

ctrl-o <enter> to save, ctrl-x to exit, followed by:

Code: Select all

sudo chmod +x /etc/rc.local
Caution: Dancing Wu Li Master and Official curmudgeon-in-chief

rene
Level 8
Level 8
Posts: 2092
Joined: Sun Mar 27, 2016 6:58 pm

Re: The domain user usually deletes applications accidentally in the desktop!

Post by rene » Wed May 02, 2018 7:08 am

ruyzz wrote:
Wed May 02, 2018 12:33 am
Chttr + i /home/domain/user/desktop/*.desktop

[ ... ]

Is there any way to do it automatically with an .sh file?
No need for a script: simply sudo chattr +i /home/domain/*/Desktop/*.desktop would work.

ruyzz
Level 1
Level 1
Posts: 18
Joined: Sat Feb 24, 2018 11:01 pm

Re: The domain user usually deletes applications accidentally in the desktop!

Post by ruyzz » Wed May 02, 2018 10:43 am

Hello rene:

It only works when users are created, not when a new one is created when joining the domain.

There is a way to make it dynamic!

rene
Level 8
Level 8
Posts: 2092
Joined: Sun Mar 27, 2016 6:58 pm

Re: The domain user usually deletes applications accidentally in the desktop!

Post by rene » Wed May 02, 2018 3:02 pm

Wasn't clear to me what the question entailed; the above reply would however still seem to to be the "Scripts & Bash" part of it? I take it now that you need some sort of trigger upon joining a domain: believe you may need to repost that part in the networking section. Personally precious little clue about Windows networking (and I do mean "precious").

ruyzz
Level 1
Level 1
Posts: 18
Joined: Sat Feb 24, 2018 11:01 pm

Re: The domain user usually deletes applications accidentally in the desktop!

Post by ruyzz » Fri May 04, 2018 10:26 am

Thanks catweazel is the solution!

There will be some way to make it work when you start the session.

rene
Level 8
Level 8
Posts: 2092
Joined: Sun Mar 27, 2016 6:58 pm

Re: The domain user usually deletes applications accidentally in the desktop!

Post by rene » Fri May 04, 2018 1:10 pm

Extremely misty thread. Only responded since I failed to notice a connection between the question and catweazel's reply -- and still do in fact. Shall however assume that "the solution" will indeed have some connection to "the question" though and thank you for reporting said solution :?

ruyzz
Level 1
Level 1
Posts: 18
Joined: Sat Feb 24, 2018 11:01 pm

Re: The domain user usually deletes applications accidentally in the desktop!

Post by ruyzz » Fri May 04, 2018 6:30 pm

Hello:

This I wrote in the rc.local file:

chattr + i /home/domain/*/Desktop/*.desktop

exit 0

User avatar
catweazel
Level 17
Level 17
Posts: 7067
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: The domain user usually deletes applications accidentally in the desktop!

Post by catweazel » Sat May 05, 2018 2:06 am

ruyzz wrote:
Fri May 04, 2018 10:26 am
Thanks catweazel
You're most welcome.
Caution: Dancing Wu Li Master and Official curmudgeon-in-chief

Post Reply

Return to “Scripts & Bash”