2024-05-04 21:05:33 -07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# @file sftpgo configuration
|
|
|
|
# @brief This script copies over the required configuration files for sftpgo and then initializes sftpgo
|
|
|
|
|
2024-05-27 04:15:03 -07:00
|
|
|
set -euo pipefail
|
|
|
|
|
2024-05-04 21:05:33 -07:00
|
|
|
if command -v sftpgo > /dev/null; then
|
2024-05-27 04:15:03 -07:00
|
|
|
### Copy configuration file
|
2024-05-04 21:05:33 -07:00
|
|
|
sudo mkdir -p /usr/local/etc/sftpgo
|
|
|
|
logg info 'Copying over sftpgo configuration to /usr/local/etc/sftpgo/sftpgo.json'
|
|
|
|
sudo cp -f "$HOME/.local/etc/sftpgo/sftpgo.json" /usr/local/etc/sftpgo/sftpgo.json
|
2024-05-27 04:15:03 -07:00
|
|
|
|
|
|
|
### Copy branding assets / banner
|
2024-05-04 21:05:33 -07:00
|
|
|
logg info 'Copying over sftpgo branding assets'
|
|
|
|
sudo cp -f "$HOME/.local/etc/sftpgo/banner" /usr/local/etc/sftpgo/banner
|
|
|
|
sudo mkdir -p /usr/local/etc/branding
|
|
|
|
sudo cp -f "$HOME/.local/etc/branding/favicon.ico" /usr/local/etc/branding/favicon.ico
|
|
|
|
sudo cp -f "$HOME/.local/etc/branding/logo-color-256x256.png" /usr/local/etc/branding/logo-color-256x256.png
|
|
|
|
sudo cp -f "$HOME/.local/etc/branding/logo-color-900x900.png" /usr/local/etc/branding/logo-color-900x900.png
|
2024-05-27 04:15:03 -07:00
|
|
|
|
|
|
|
### Initialize
|
2024-05-04 21:05:33 -07:00
|
|
|
logg info 'Running sudo sftpgo initprovider'
|
|
|
|
sudo sftpgo initprovider
|
|
|
|
else
|
|
|
|
logg info 'sftpgo is not installed'
|
|
|
|
fi
|