This file is indexed.

/sbin/fs2ram is in fs2ram 0.3.12.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  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
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
#! /bin/sh

# Author:
#
#     Philippe Le Brouster <plb@nebkha.net>
#
# Copyright:
#
#     Copyright (C) 2009 - 2010 Philippe Le Brouster <plb@nebkha.net>
#
# License:
#
#     This program is free software: you can redistribute it and/or modify
#     it under the terms of the GNU General Public License as published by
#     the Free Software Foundation, either version 3 of the License, or
#     (at your option) any later version.
#
#     This package is distributed in the hope that it will be useful,
#     but WITHOUT ANY WARRANTY; without even the implied warranty of
#     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#     GNU General Public License for more details.
#
#     You should have received a copy of the GNU General Public License
#     along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
# On Debian systems, the complete text of the GNU General
# Public License version 3 can be found in `/usr/share/common-licenses/GPL-3'.

. /lib/init/fs2ram-functions.sh


print_usage() {
    echo "Command usage:"
    echo ""
    echo "$0 <action> <mountpoint> [-f]"
    echo "$0 <action> -a [-f]"
    echo "$0 -v"
    echo ""
    echo "<action>"
    echo "    mount-only              Mount the mountpoint <mountpoint>."
    echo "    unmount-only            Unmount the mountpoint <mountpoint>."
    echo "    execute-unmount-script  Execute the unmount script for the mountpoint <mountpoint>."
    echo "    execute-mount-script    Execute the mount script for the mountpoint <mountpoint>. "
    echo "    mount                   Do mount & execute mount script. If '-f' is given,"
    echo "                            this will execute the mount script even if mount failed."
    echo "    unmount                 Execute unmount script & do unmount. If '-f' is given,"
    echo "                            this will unmount even if backup failed. "
    echo ""
    echo "-a"
    echo "    This means that the <action> given will be proceeded for all the mountpoints defined in /etc/fs2ram/fs2ram.conf."
    echo "-h"
    echo "    Display the command usage for $0."
}

print_usage_exit() {
    print_usage
    exit
}

force='false'
quiet='false'
mountpoint='%%none%%'
all_mountpoints='false'

action="$1"
[ -z "$action" ] && print_usage_exit;

shift

while [ $# -gt 0 ]; do
    case "$1" in
        -a)
            [ "$mountpoint" != "%%none%%" ] && print_usage_exit
            mountpoint=""
            ;;

        -f)
            force='true'
            ;;

        -q)
            quiet='true'
            ;;

        *)
            [ -z "$mountpoint" ] || [ "$mountpoint" != '%%none%%' ] && print_usage_exit
            mountpoint="$1"
            ;;
    esac
    shift
done

[ "$mountpoint" = "%%none%%" ] && print_usage_exit

case "$action" in
    mount-only|unmount-only|unmount|mount|execute-unmount-script|execute-mount-script)
        do_mountpoint "$mountpoint" "$action" "$force" "$quiet"
        ;;
    *|-h)
        print_usage
        ;;
esac