mirror of https://github.com/dswd/vpncloud.git
Compare commits
2 Commits
97e168c856
...
665b190257
Author | SHA1 | Date |
---|---|---|
Dennis Schwerdel | 665b190257 | |
Dennis Schwerdel | ff75845dfb |
|
@ -41,6 +41,7 @@ rm -rf %{buildroot}
|
||||||
/etc/vpncloud/example.net.disabled
|
/etc/vpncloud/example.net.disabled
|
||||||
/usr/bin/vpncloud
|
/usr/bin/vpncloud
|
||||||
/lib/systemd/system/vpncloud@.service
|
/lib/systemd/system/vpncloud@.service
|
||||||
|
/lib/systemd/system/vpncloud.target
|
||||||
/lib/systemd/system/vpncloud-wsproxy.service
|
/lib/systemd/system/vpncloud-wsproxy.service
|
||||||
/usr/share/man/man1/vpncloud.1.gz
|
/usr/share/man/man1/vpncloud.1.gz
|
||||||
|
|
||||||
|
|
|
@ -23,10 +23,10 @@ pub fn install() -> Result<(), Error> {
|
||||||
env::current_exe()
|
env::current_exe()
|
||||||
.and_then(|p| fs::copy(p, "/usr/bin/vpncloud"))
|
.and_then(|p| fs::copy(p, "/usr/bin/vpncloud"))
|
||||||
.map_err(|e| Error::FileIo("Failed to copy binary", e))?;
|
.map_err(|e| Error::FileIo("Failed to copy binary", e))?;
|
||||||
fs::set_permissions("/usr/bin/vpncloud", fs::Permissions::from_mode(755))
|
fs::set_permissions("/usr/bin/vpncloud", fs::Permissions::from_mode(0o755))
|
||||||
.map_err(|e| Error::FileIo("Failed to set permissions for binary", e))?;
|
.map_err(|e| Error::FileIo("Failed to set permissions for binary", e))?;
|
||||||
fs::create_dir_all("/etc/vpncloud").map_err(|e| Error::FileIo("Failed to create config folder", e))?;
|
fs::create_dir_all("/etc/vpncloud").map_err(|e| Error::FileIo("Failed to create config folder", e))?;
|
||||||
fs::set_permissions("/etc/vpncloud", fs::Permissions::from_mode(700))
|
fs::set_permissions("/etc/vpncloud", fs::Permissions::from_mode(0o700))
|
||||||
.map_err(|e| Error::FileIo("Failed to set permissions for config folder", e))?;
|
.map_err(|e| Error::FileIo("Failed to set permissions for config folder", e))?;
|
||||||
File::create("/etc/vpncloud/example.net.disabled")
|
File::create("/etc/vpncloud/example.net.disabled")
|
||||||
.and_then(|mut f| f.write_all(EXAMPLE_CONFIG))
|
.and_then(|mut f| f.write_all(EXAMPLE_CONFIG))
|
||||||
|
|
|
@ -498,7 +498,7 @@ pub fn configure(name: Option<String>) -> Result<(), io::Error> {
|
||||||
let f = fs::File::create(&file)?;
|
let f = fs::File::create(&file)?;
|
||||||
serde_yaml::to_writer(f, &config_file)
|
serde_yaml::to_writer(f, &config_file)
|
||||||
.map_err(|_| io::Error::new(io::ErrorKind::InvalidData, "Failed to parse config file"))?;
|
.map_err(|_| io::Error::new(io::ErrorKind::InvalidData, "Failed to parse config file"))?;
|
||||||
fs::set_permissions(file, fs::Permissions::from_mode(600))?;
|
fs::set_permissions(file, fs::Permissions::from_mode(0o600))?;
|
||||||
println!();
|
println!();
|
||||||
println!("Use the following commands to control your VPN:");
|
println!("Use the following commands to control your VPN:");
|
||||||
println!(" start the VPN: sudo service vpncloud@{0} start", name);
|
println!(" start the VPN: sudo service vpncloud@{0} start", name);
|
||||||
|
|
Loading…
Reference in New Issue