forked from snwh/ubuntu-post-install
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_thirdparty
executable file
·55 lines (52 loc) · 1.54 KB
/
install_thirdparty
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
#!/bin/bash
#
# When adding (or removing) any functions remember to update
# the 'install_thirdparty' function below to reflect any changes you make
# Automatically import apps functions
function import_apps_functions {
DIR="functions/apps"
# iterate through the files in the 'functions/apps' folder
for FUNCTION in $(dirname "$0")/$DIR/*; do
if [[ -d $FUNCTION ]]; then
continue
elif [[ -f $FUNCTION ]]; then
# source the function file
. $FUNCTION
fi
done
}
# Install Third-Party Applications
function install_thirdparty {
NAME="Third-Party Software"
echo_message title "Starting installation of ${NAME,,}..."
import_apps_functions
# Draw window
THIRDPARTY=$(eval `resize` && whiptail \
--notags \
--title "Install $NAME" \
--menu "\nWhat ${NAME,,} would you like to install?" \
--ok-button "Install" \
--cancel-button "Go Back" \
$LINES $COLUMNS $(( $LINES - 12 )) \
'install_chrome' 'Google Chrome' \
'install_dropbox' 'Dropbox' \
'install_oracle_java' 'Oracle Java' \
'install_sublime_text' 'Sublime Text 3' \
'install_slack' 'Slack' \
'install_skype' 'Skype' \
'install_telegram' 'Telegram' \
'install_idea_ultimate' 'IntelliJ IDEA Ultimate' \
'install_idea_community' 'IntelliJ IDEA Community' \
'install_teamviewer' 'Teamviewer' \
'install_anydesk' 'AnyDesk' \
3>&1 1>&2 2>&3)
# check exit status
if [ $? = 0 ]; then
echo_message header "Starting '$THIRDPARTY' function..."
$THIRDPARTY
else
# Cancelled
echo_message info "Installation of ${NAME,,} cancelled."
main
fi
}