blob: c4185ac16c311e531d96d23225fbb9aac2cfcb8f (
plain)
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
36
37
38
39
40
41
42
43
44
45
|
#! /bin/sh
# Creates cdsymlinks in /dev
# for Archlinux by Tobias Powalowski <tpowa@archlinux.org>
if [ -d /dev/cd ]; then
rm /dev/cdrom*
rm /dev/cdrw*
rm /dev/dvd*
rm /dev/dvdrw*
for i in /dev/cd/cdrom-*; do
if [ -h $i ]; then
[ "$CD_NUMBER" = "" ] && ln -s $i /dev/cdrom
[ "$CD_NUMBER" = "" ] && CD_NUMBER="-1"
! [ "$CD_NUMBER" = "" ] && CD_NUMBER="$((CD_NUMBER+1))" && ln -s $i /dev/cdrom$CD_NUMBER
fi
done
for i in /dev/cd/cdrw-*; do
if [ -h $i ]; then
[ "$CDRW_NUMBER" = "" ] && ln -s $i /dev/cdrw
[ "$CDRW_NUMBER" = "" ] && CDRW_NUMBER="-1"
! [ "$CDRW_NUMBER" = "" ] && CDRW_NUMBER="$((CDRW_NUMBER+1))" && ln -s $i /dev/cdrw$CDRW_NUMBER
fi
done
for i in /dev/cd/dvd-*; do
if [ -h $i ]; then
[ "$DVD_NUMBER" = "" ] && ln -s $i /dev/dvd
[ "$DVD_NUMBER" = "" ] && DVD_NUMBER="-1"
! [ "$DVD_NUMBER" = "" ] && DVD_NUMBER="$((DVD_NUMBER+1))" && ln -s $i /dev/dvd$DVD_NUMBER
fi
done
for i in /dev/cd/dvdrw-*; do
if [ -h $i ]; then
[ "$DVDRW_NUMBER" = "" ] && ln -s $i /dev/dvdrw
[ "$DVDRW_NUMBER" = "" ] && DVDRW_NUMBER="-1"
! [ "$DVDRW_NUMBER" = "" ] && DVDRW_NUMBER="$((DVDRW_NUMBER+1))" && ln -s $i /dev/dvdrw$DVDRW_NUMBER
fi
done
else
rm /dev/cdrom*
rm /dev/cdrw*
rm /dev/dvd*
rm /dev/dvdrw*
fi
|