-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplay
More file actions
executable file
·33 lines (28 loc) · 811 Bytes
/
play
File metadata and controls
executable file
·33 lines (28 loc) · 811 Bytes
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
#!/bin/bash
# check if a cast name is provided as an argument
if [ $# -ne 1 ]; then
echo "Usage: play <cast_name>"
echo ""
echo "Available casts:"
for cast in /var/casts/*.cast; do
cast_name=$(basename "$cast" .cast)
description_file="/var/casts/$cast_name.txt"
if [ -f "$description_file" ]; then
description=$(cat "$description_file")
echo "$cast_name - $description"
else
echo "$cast_name"
fi
done
exit 1
fi
cast=$1
# check if file exists
if [ ! -e "/var/casts/$cast.cast" ]; then
echo "Video cast $cast does not exist."
exit 1
fi
echo "***************************************************"
echo "playing video cast $cast - press ctrl + c to cancel"
echo "***************************************************"
asciinema play /var/casts/$cast.cast