-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add install script and desktop entry for Linux
- Loading branch information
Showing
2 changed files
with
61 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,53 @@ | ||
#!/bin/sh | ||
|
||
# JPass installation script for Linux | ||
|
||
# check if java executable exists | ||
if [ -d "$JAVA_HOME" -a -x "$JAVA_HOME/bin/java" ]; then | ||
JAVACMD="$JAVA_HOME/bin/java" | ||
else | ||
JAVACMD=java | ||
fi | ||
|
||
$JAVACMD -version >/dev/null 2>&1 | ||
if [ "$?" != "0" ]; then | ||
echo "Install Java (JDK or JRE) if you do not already have. JPass will not work without it." | ||
echo "Please make sure PATH, or JAVA_HOME environment variables point to a valid Java installation." | ||
echo "Could not execute JPass (exit: $?)" | ||
exit | ||
fi | ||
|
||
# detect the absolute path of jpass | ||
JPASS_HOME=`dirname "$0"` | ||
|
||
# detect cygwin | ||
cygwin=false; | ||
case "`uname -s`" in | ||
CYGWIN*) | ||
cygwin=true | ||
;; | ||
esac | ||
|
||
if $cygwin ; then | ||
JPASS_PATH=`cygpath "$JPASS_HOME"` | ||
else | ||
JPASS_PATH="$JPASS_HOME" | ||
fi | ||
|
||
echo "Install application to /opt/jpass..." | ||
if [ ! -d "/opt" ]; then | ||
echo "ERROR: /opt folder does not exists" | ||
exit | ||
fi | ||
|
||
mkdir -p "/opt/jpass" | ||
cp -R "$JPASS_PATH" "/opt/jpass" | ||
|
||
echo "Add JPass desktop entry..." | ||
if [ ! -d "/usr/share/applications" ]; then | ||
echo "ERROR: Could not create desktop entry: /usr/share/applications is missing" | ||
exit | ||
fi | ||
|
||
cp "$JPASS_PATH/jpass.desktop" "/usr/share/applications" | ||
|
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,8 @@ | ||
[Desktop Entry] | ||
Type=Application | ||
Encoding=UTF-8 | ||
Name=JPass | ||
Comment=Password manager with strong encryption | ||
Exec=/opt/jpass/jpass.sh | ||
Icon=/opt/jpass/jpass.png | ||
Terminal=False |