first commit
This commit is contained in:
Executable
+33
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
# Installiert NetClip nach /opt/netclip (als root) oder ~/.local/opt/netclip (als Benutzer).
|
||||
# Optional: ./install-linux.sh --server https://clip.example.de --token XYZ [--insecure]
|
||||
# schreibt die Vorgaben nach config.default.json (gilt fuer alle Benutzer beim ersten Start).
|
||||
set -e
|
||||
SRC=$(cd "$(dirname "$0")" && pwd)
|
||||
if [ "$(id -u)" = 0 ]; then
|
||||
DEST=/opt/netclip; BIN=/usr/local/bin; APPS=/usr/share/applications
|
||||
else
|
||||
DEST=$HOME/.local/opt/netclip; BIN=$HOME/.local/bin; APPS=$HOME/.local/share/applications
|
||||
fi
|
||||
mkdir -p "$DEST" "$BIN" "$APPS"
|
||||
cp -a "$SRC"/. "$DEST"/
|
||||
ln -sf "$DEST/NetClip" "$BIN/netclip"
|
||||
cp "$SRC/netclip.desktop" "$APPS/netclip.desktop"
|
||||
|
||||
SERVER=""; TOKEN=""; KEY=""; VERIFY=true
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--server) SERVER=$2; shift ;;
|
||||
--token) TOKEN=$2; shift ;;
|
||||
--server-key) KEY=$2; shift ;;
|
||||
--insecure) VERIFY=false ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
if [ -n "$SERVER" ]; then
|
||||
printf '{"server": "%s", "token": "%s", "server_key": "%s", "verify_tls": %s, "autostart": true}\n' \
|
||||
"$SERVER" "$TOKEN" "$KEY" "$VERIFY" > "$DEST/config.default.json"
|
||||
chmod 644 "$DEST/config.default.json"
|
||||
fi
|
||||
echo "NetClip installiert in $DEST, Start mit: netclip"
|
||||
echo "Hinweis Wayland: Paket wl-clipboard installieren (apt install wl-clipboard)."
|
||||
Reference in New Issue
Block a user