-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstaller.sh
More file actions
executable file
·41 lines (30 loc) · 917 Bytes
/
installer.sh
File metadata and controls
executable file
·41 lines (30 loc) · 917 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
34
35
36
37
38
39
40
41
#!/bin/sh
set -e
## installer for fliegwerk/mediacenter
## by fliegwerk
## (c) 2020. MIT License
INSTALL_FILES="index.php config.php search.php main.css badges"
HTACCESS=".htaccess"
[ "$(id -u)" -eq 0 ] || { printf "Root privileges required\n"; exit 1; }
printf "Path to http directory: "
read -r HTTP_PATH
[ -d "$HTTP_PATH" ] || { printf "Path to http directory not found\n"; exit 1; }
printf "Copy files\n"
cp -r $INSTALL_FILES "${HTTP_PATH}/"
printf "Path to video directory: "
read -r VIDEO_PATH
[ -d "$VIDEO_PATH" ] || { printf "Path to video directory not found\n"; exit 1; }
printf "Link video directory"
ln -s "$VIDEO_PATH" "${HTTP_PATH}/movies"
printf "Would you like to install the .htaccess file? (y/n) "
read -r CHOICE
case "$CHOICE" in
y|Y)
printf "Copy configuration\n"
cp "$HTACCESS" "${HTTP_PATH}/"
;;
*)
printf "Skipping\n"
;;
esac
printf "Installation finished\n"