-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds installation script for linux from archive
Signed-off-by: Saahil Bhavsar <saahil_bhavsar@outlook.com>
- Loading branch information
1 parent
52b4b65
commit 5dc0e9e
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Check if script is run as root | ||
if [ "$(id -u)" -ne 0 ]; then | ||
echo "This script must be run as root. Restarting as root..." | ||
sudo "$0" "$@" | ||
exit $? | ||
fi | ||
|
||
# Define directories | ||
binDir="bin" | ||
configDir="scripts" | ||
installDir="/usr/bin" | ||
configInstallDir="/etc/spok" | ||
readmeDir="/usr/share/doc/spok" | ||
licenseDir="/usr/share/licenses/spok" | ||
|
||
# Create installation directories if they don't exist | ||
mkdir -p "$configInstallDir" | ||
mkdir -p "$readmeDir" | ||
mkdir -p "$licenseDir" | ||
|
||
# Copy binaries | ||
cp "$binDir/spok" "$installDir" | ||
cp "$configDir/configure-spok-server.sh" "$configInstallDir" | ||
cp "README.md" "$readmeDir" | ||
cp "LICENSE" "$licenseDir" | ||
|
||
echo "Installation of SPoK completed successfully!" |