File: prerm

package info (click to toggle)
lshell 2.01-11
  • links: PTS
  • area: main
  • in suites: woody
  • size: 116 kB
  • ctags: 9
  • sloc: sh: 155; ansic: 141; makefile: 39
file content (35 lines) | stat: -rw-r--r-- 541 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#! /bin/sh
set -e
grep '^[[:space:]]*/' /etc/shells |
while read shell
do
	dirname "$shell"
done |
sort -u |
while read dir
do
#
#	cd to lshells directory, note that /lshell may already be present in
#	/etc/shells
#
	if [ "x`basename $dir`" = "xlshells" ]
	then
		cd $dir || continue
	else
		cd $dir/lshells || continue
	fi
	grep '^[[:space:]]*/' /etc/shells |
	grep ^$dir |
	while read shell
	do
#
#		finally remove the link
#
		/bin/rm -f `basename $shell` 
		( cd .. && rmdir lshells 2>/dev/null || true )
	done
done

#DEBHELPER#

exit 0