Files
furumi-ng/furumi-mount-linux/debian/postinst
AB-UK bc34b6bc41
All checks were successful
Build and Publish Deb Package / build-deb (push) Successful in 2m17s
Publish Server Image / build-and-push-image (push) Successful in 4m35s
Added systemd unit
2026-03-13 16:31:58 +00:00

37 lines
1.0 KiB
Bash

#!/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