| Revision 8717,
420 bytes
checked in by daisuke, 12 years ago
(diff) |
|
add initial version
|
-
Property svn:executable set to
*
|
| Line | |
|---|
| 1 | #!/bin/bash |
|---|
| 2 | if [ x`pwd` = "x/etc" ] |
|---|
| 3 | then |
|---|
| 4 | echo Cannot operate directly on \"/etc\". >&2 |
|---|
| 5 | exit 1 |
|---|
| 6 | fi |
|---|
| 7 | |
|---|
| 8 | #make prototype for /etc/shadow |
|---|
| 9 | sed -e "s/:.*/:*:`expr $(date +%s) / 86400`:0:99999:7:::/" passwd >shadow |
|---|
| 10 | |
|---|
| 11 | #make prototype for /etc/gshadow |
|---|
| 12 | sed -e 's/:[0-9]\+:/::/g' group >gshadow |
|---|
| 13 | |
|---|
| 14 | #mark passwd and group files entries shadowed |
|---|
| 15 | sed -i -e 's/^\([^:]\+\):[^:]*:/\1:x:/' passwd group |
|---|
| 16 | |
|---|
| 17 | echo Converted successfully. |
|---|
| 18 | exit 0 |
|---|
Note: See
TracBrowser
for help on using the repository browser.