SMS Server Tools 3
This site is hosted by Kekekasvi.com
 Menu
Basic information:
Additional information:
Support:
Get SMS Server Tools 3:
Additional Options

 Sponsored links

 Search
Custom Search

 Visitor locations
 
 SMS Server Tools 3 Community
Welcome, Guest. Please login or register. Fri Mar 29, 2024 05:29
SMSTools3 Community » Help and support Bottom

[solved] sed changes file permissions

  This topic is locked

Page:  1

Author Post
Member
Registered:
Jun 2009
Location: Russian Federation
Hello all ,

I have wrote eventhandler script to edit smsd.conf file automatically via sed.
It is useful solution to disable / enable modems based on various conditions.
Here is code snippset



The script replaces some portion of smsd.conf file with aid of just in place editing feature of sed ( sed -i ).
This works fine.
However after such operation file permissions on smsd.conf file are changed and system admin has no ability to edit it manually.

Please advice , what is the proper way to edit file with storing file permissions unchanged.

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
Can you re-check this issue?

I just tried this using sed -i, and it did not change the file permissions. The file was 644 and smsd:dialout, and after sed -i was run by the root, permissions and ownership were the same. Changes to the file were made correctly, but it was just a single line change.

Member
Registered:
Jun 2009
Location: Russian Federation
Topic owner
what is your sed version number ?

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
GNU sed version 4.1.2

Member
Registered:
Jun 2009
Location: Russian Federation
Topic owner
may be this is version dependent feature. I will explore it.

Thanks !

Member
Registered:
Jun 2009
Location: Russian Federation
Topic owner
Please close this post.
sed handles file permissins properly during inline editing.

my mistake.

  This topic is locked

Page:  1

SMSTools3 Community » Help and support Top

 
Time in this board is UTC.  

Privacy Policy   SMS Server Tools 3 Copyright © Keijo Kasvi.