summaryrefslogtreecommitdiff
path: root/shadowconvert.sh
blob: 006046da759e7c510e6b2bb53d569bc6aa4dd369 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash
if [ x`pwd` = "x/etc" ]
then
  echo Cannot operate directly on \"/etc\". >&2
  exit 1
fi

#make prototype for /etc/shadow
sed -e "s/:.*/:*:`expr $(date +%s) / 86400`:0:99999:7:::/" passwd >shadow

#make prototype for /etc/gshadow
sed -e 's/:[0-9]\+:/::/g' group >gshadow

echo Converted successfully.
exit 0