-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
50 lines (37 loc) · 944 Bytes
/
install.sh
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
#!/bin/bash
IMAGE=singularity-compression
DIRECTORY=~/.singularity
if [ ! -d $DIRECTORY ]; then
mkdir $DIRECTORY
fi
if [ ! -d ~/bin ]; then
mkdir ~/bin
fi
if [ ! -f $DIRECTORY/$(echo $IMAGE | cut -d"-" -f2).simg ]; then
singularity pull --name $(echo $IMAGE | cut -d"-" -f2).simg shub://icaoberg/$IMAGE
mv -v $(echo $IMAGE | cut -d"-" -f2).simg $DIRECTORY
fi
# ┌───┐
# │RAR│
# └───┘
cat << EOF > ~/bin/rar
#!/bin/bash
singularity run --app rar ~/.singularity/$(echo $IMAGE | cut -d"-" -f2).simg $1
EOF
chmod +x ~/bin/rar
# ┌─────┐
# │UNRAR│
# └─────┘
cat << EOF > ~/bin/unrar
#!/bin/bash
singularity run --app unrar ~/.singularity/$(echo $IMAGE | cut -d"-" -f2).simg $1
EOF
chmod +x ~/bin/unrar
# ┌──┐
# │7z│
# └──┘
cat << EOF > ~/bin/7z
#!/bin/bash
singularity run --app 7z ~/.singularity/$(echo $IMAGE | cut -d"-" -f2).simg $1
EOF
chmod +x ~/bin/7z