summarylogtreecommitdiffstats
path: root/usbmount.install
blob: 303f018fc696ed4b62473dc85e4e27a2aeaa3cff (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
pre_install() {
    # If the package is installed, try to create the default mountpoints.
    # Failure to do so is not considered fatal.
    mkdir /media 2> /dev/null || :
    for i in 0 1 2 3 4 5 6 7; do
        mkdir /media/usb$i 2> /dev/null || :
    done
    ln -s usb0 /media/usb 2> /dev/null || :
}

pre_remove() {
    # Remove contents of /var/run/usbmount before the package is removed.
    rm -f /var/run/usbmount/*
}

post_remove() {
    # If the package is removed, purged or installation is aborted, try to
    # remove the default mountpoints.
    #
    # Failure to do so is not considered fatal, because they may be in use by
    # the system administrator or some other daemon on the system.
    rm -f /media/usb 2> /dev/null || :
    for i in 0 1 2 3 4 5 6 7; do
        rmdir /media/usb$i 2> /dev/null || :
    done

    # During purge, also remove the /etc/udev/rules.d/z60_usbmount.rules symlink
    # if it exists.
    rm -f /etc/udev/rules.d/z60_usbmount.rules
}