@@ -11,14 +11,14 @@ use std::process::Command;
1111use anyhow:: { bail, Context } ;
1212
1313/// Systemd service name used for the unit file and `systemctl` commands.
14- const SERVICE_NAME : & str = "https-proxy " ;
14+ const SERVICE_NAME : & str = "https_proxy " ;
1515
1616/// Install the proxy as a systemd service.
1717///
1818/// Performs the following steps:
19- /// 1. Copies the current binary to `/usr/local/bin/https-proxy `
20- /// 2. Copies the config file to `/etc/https-proxy /config.yaml`
21- /// 3. Writes a systemd unit file to `/etc/systemd/system/https-proxy .service`
19+ /// 1. Copies the current binary to `/usr/local/bin/https_proxy `
20+ /// 2. Copies the config file to `/etc/https_proxy /config.yaml`
21+ /// 3. Writes a systemd unit file to `/etc/systemd/system/https_proxy .service`
2222/// 4. Runs `systemctl daemon-reload`, `enable`, and `restart`
2323///
2424/// Requires root privileges.
@@ -46,9 +46,9 @@ pub fn install_service(config_path: String) -> anyhow::Result<()> {
4646 fs:: copy ( & exe, & installed_bin)
4747 . with_context ( || format ! ( "failed to copy binary to {}" , installed_bin. display( ) ) ) ?;
4848
49- // Copy config to /etc/https-proxy /
50- let config_dir = Path :: new ( "/etc/https-proxy " ) ;
51- fs:: create_dir_all ( config_dir) . context ( "failed to create /etc/https-proxy /" ) ?;
49+ // Copy config to /etc/https_proxy /
50+ let config_dir = Path :: new ( "/etc/https_proxy " ) ;
51+ fs:: create_dir_all ( config_dir) . context ( "failed to create /etc/https_proxy /" ) ?;
5252 let installed_config = config_dir. join ( "config.yaml" ) ;
5353 println ! ( "Installing config to {}" , installed_config. display( ) ) ;
5454 fs:: copy ( & config, & installed_config)
@@ -81,7 +81,7 @@ pub fn install_service(config_path: String) -> anyhow::Result<()> {
8181/// Uninstall the systemd service.
8282///
8383/// Stops and disables the service, removes the binary and unit file, but
84- /// preserves `/etc/https-proxy /` (user configuration). Requires root.
84+ /// preserves `/etc/https_proxy /` (user configuration). Requires root.
8585pub fn uninstall_service ( ) -> anyhow:: Result < ( ) > {
8686 if !cfg ! ( target_os = "linux" ) {
8787 bail ! ( "service uninstallation is only supported on Linux with systemd" ) ;
@@ -101,8 +101,8 @@ pub fn uninstall_service() -> anyhow::Result<()> {
101101 }
102102 }
103103
104- // Keep /etc/https-proxy / config dir (user data)
105- println ! ( "Config directory /etc/https-proxy / preserved." ) ;
104+ // Keep /etc/https_proxy / config dir (user data)
105+ println ! ( "Config directory /etc/https_proxy / preserved." ) ;
106106
107107 run_cmd ( "systemctl" , & [ "daemon-reload" ] ) ?;
108108
0 commit comments