-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·74 lines (54 loc) · 2.07 KB
/
install.sh
File metadata and controls
executable file
·74 lines (54 loc) · 2.07 KB
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
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
printf "%s\n" "This script must be run as root" 1>&2
exit 1
fi
# Vars
curPath=$(pwd)
installPath="/usr/bin/"
installDesktopPath="/usr/share/applications/"
installIconPath="/usr/share/icons/oxygen/22x22/apps/"
scriptName="jusLinkComposer"
installFunc () {
cp "${scriptName}.sh" "${installPath}"
chmod 0755 "${installPath}${scriptName}.sh"
cp "${scriptName}.desktop" "${installDesktopPath}"
chmod 0755 "${installDesktopPath}${scriptName}.desktop"
cp "${scriptName}.png" "${installIconPath}"
chmod 0755 "${installIconPath}${scriptName}.png"
}
uninstallFunc () {
rm "${installPath}${scriptName}.sh"
rm "${installDesktopPath}${scriptName}.desktop"
rm "${installIconPath}${scriptName}.png"
}
symlinkFunc () {
ln -s "${curPath}/${scriptName}.sh" "${installPath}"
chmod 0755 "${installPath}${scriptName}.sh"
ln -s "${curPath}/${scriptName}.desktop" "${installDesktopPath}"
chmod 0755 "${installDesktopPath}${scriptName}.desktop"
ln -s "${curPath}/${scriptName}.png" "${installIconPath}"
chmod 0755 "${installIconPath}${scriptName}.png"
}
case "${1}" in
install) printf "%s\n" "Installing ...."
installFunc
printf "%s\n" "... Installat complete."
;;
uninstall) printf "%s\n" "Uninstalling ..."
uninstallFunc
printf "%s\n" "... Uninstall complete."
;;
symlink) printf "%s\n" "Symlinking ..."
symlinkFunc
printf "%s\n" "... Symlink complete"
;;
*) printf "%s\n" "Use: run as root: ./install.sh PARAMETER"
printf "%s\n" ""
printf "%s\n" ""
printf "%s\n" "Possible options for PARAMETER1"
printf "%s\n" "symlink - instead of copying the files to their according location it just symlinks them; this is good for when you update the git repo --> this is RECOMMENDED"
printf "%s\n" "install - this will copy the files to their according location"
printf "%s\n" "uninstall - this will remove the files from their according location, however it'll leave the config files intact"
;;
esac