37 lines
1.0 KiB
Plaintext
37 lines
1.0 KiB
Plaintext
|
|
#!/bin/bash
|
||
|
|
set -e
|
||
|
|
|
||
|
|
if [ "$1" = "configure" ]; then
|
||
|
|
if [ -n "$SUDO_USER" ] && [ "$SUDO_USER" != "root" ]; then
|
||
|
|
REAL_USER="$SUDO_USER"
|
||
|
|
REAL_HOME=$(getent passwd "$SUDO_USER" | cut -d: -f6)
|
||
|
|
|
||
|
|
CONFIG_DIR="$REAL_HOME/.config/furumi"
|
||
|
|
CONFIG_FILE="$CONFIG_DIR/config"
|
||
|
|
|
||
|
|
if [ ! -f "$CONFIG_FILE" ]; then
|
||
|
|
mkdir -p "$CONFIG_DIR"
|
||
|
|
cat > "$CONFIG_FILE" << 'EOF'
|
||
|
|
# Furumi mount configuration
|
||
|
|
# Edit the values below, then enable and start the service:
|
||
|
|
#
|
||
|
|
# systemctl --user enable --now furumi-mount.service
|
||
|
|
#
|
||
|
|
# To apply changes after editing this file:
|
||
|
|
#
|
||
|
|
# systemctl --user restart furumi-mount.service
|
||
|
|
|
||
|
|
FURUMI_SERVER=your-server:50051
|
||
|
|
FURUMI_TOKEN=your-token-here
|
||
|
|
FURUMI_MOUNT=/path/to/mountpoint
|
||
|
|
EOF
|
||
|
|
chown -R "$REAL_USER:$REAL_USER" "$CONFIG_DIR"
|
||
|
|
echo ""
|
||
|
|
echo "furumi-mount: config created at $CONFIG_FILE"
|
||
|
|
echo "furumi-mount: edit the file, then run:"
|
||
|
|
echo " systemctl --user enable --now furumi-mount.service"
|
||
|
|
echo ""
|
||
|
|
fi
|
||
|
|
fi
|
||
|
|
fi
|