File: definefunc.sh

package info (click to toggle)
bashburn 3.0.1-2~deb7u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,140 kB
  • sloc: sh: 2,584; sed: 64; makefile: 19
file content (54 lines) | stat: -rwxr-xr-x 1,122 bytes parent folder | download | duplicates (2)
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
# Functions for data definition

copy_link_data()
{
    cd ${BBBURNDIR}
    echo $bb_dc_explain1
    echo "$bb_dc_explain2a${BBBURNDIR}$bb_dc_explain2b"
    echo $bb_dc_explain3
    echo $bb_dc_explain4
    echo $bb_dc_explain5
    echo $bb_dc_explain6
    echo $bb_dc_explain7
    echo $bb_dc_explain8
    bash
}

view_contents()
{
    if is_dir_empty "${BBBURNDIR}"
    then
	echo "$bb_dc_ch3_4 ${BBBURNDIR}"
    else
#	ls -lhgG --color ${BBBURNDIR} # Nick - I prefer this so symlinks show... comments?
#	ls -lhgGL --color ${BBBURNDIR} 
	ls -L --color ${BBBURNDIR} # Just list files without extra info - Anders
	display_burndir_size
    fi
}

delete_data()
{
    typeset choice
    if is_dir_empty "${BBBURNDIR}"
    then
	echo "$bb_dc_ch3_4 ${BBBURNDIR}"
    else
	ls -lhgGL --color ${BBBURNDIR}
	echo -en "\n$bb_dc_ch3_1"
	read -e choice
	if [[ "$choice" = y ]]
	then
	    rm -rf ${BBBURNDIR}/*
	    echo -ne "\n$bb_dc_ch3_2\n\n"
	else
	    echo -ne "\n$bb_dc_ch3_3\n\n"
	fi
    fi
}

# Print size of burndir. Follows symlinks.
display_burndir_size()
{
    echo; echo "Size of data to burn: $(du -shL ${BBBURNDIR})"
}