-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall-eSim.sh
More file actions
81 lines (73 loc) · 2.39 KB
/
Copy pathinstall-eSim.sh
File metadata and controls
81 lines (73 loc) · 2.39 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
75
76
77
78
79
80
81
#!/bin/bash
#=============================================================================
# FILE: install-eSim.sh
#
# USAGE: ./install-eSim.sh --install
# OR
# ./install-eSim.sh --uninstall
#
# DESCRIPTION: Installation script for eSim EDA Suite
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHORS: Fahim Khan, Rahul Paknikar, Saurabh Bansode,
# Sumanto Kar, Partha Singha Roy, Jayanth Tatineni,
# Anshul Verma, Shiva Krishna Sangati, Harsha Narayana P
# ORGANIZATION: eSim Team, FOSSEE, IIT Bombay
# CREATED: Sunday 25 May 2025 17:40
# REVISION: ---
#=============================================================================
# Function to detect Ubuntu version and full version string
get_ubuntu_version() {
VERSION_ID=$(grep "^VERSION_ID" /etc/os-release | cut -d '"' -f 2)
FULL_VERSION=$(lsb_release -d | grep -oP '\d+\.\d+\.\d+')
echo "Detected Ubuntu Version: $FULL_VERSION"
}
# Function to choose and run the appropriate script
run_version_script() {
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/install-eSim-scripts"
# Decide script based on full version
case $VERSION_ID in
"22.04")
if [[ "$FULL_VERSION" == "22.04.4" ]]; then
SCRIPT="$SCRIPT_DIR/install-eSim-22.04.sh"
else
SCRIPT="$SCRIPT_DIR/install-eSim-23.04.sh"
fi
;;
"23.04")
SCRIPT="$SCRIPT_DIR/install-eSim-23.04.sh"
;;
"24.04")
SCRIPT="$SCRIPT_DIR/install-eSim-24.04.sh"
;;
*)
echo "Unsupported Ubuntu version: $VERSION_ID ($FULL_VERSION)"
exit 1
;;
esac
# Run the script if found
if [[ -f "$SCRIPT" ]]; then
echo "Running script: $SCRIPT $ARGUMENT"
bash "$SCRIPT" "$ARGUMENT"
else
echo "Installation script not found: $SCRIPT"
exit 1
fi
}
# --- Main Execution Starts Here ---
# Validate argument
if [[ $# -ne 1 ]]; then
echo "Usage: $0 --install | --uninstall"
exit 1
fi
ARGUMENT=$1
if [[ "$ARGUMENT" != "--install" && "$ARGUMENT" != "--uninstall" ]]; then
echo "Invalid argument: $ARGUMENT"
echo "Usage: $0 --install | --uninstall"
exit 1
fi
get_ubuntu_version
run_version_script