aboutsummaryrefslogtreecommitdiff
path: root/sfmain.c
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2022-04-15 10:59:31 +0200
committerJavier <dev.git@javispedro.com>2022-04-15 10:59:31 +0200
commit0f0a806e22895c5b7a6244e951c4f475a25184f8 (patch)
tree10aa1e1e8b838d06eacdcfd78a341d1a3634eda3 /sfmain.c
parent30c3e414c423bcbfe10b1e40bb8a0e01d3eec7c9 (diff)
downloadvbados-0f0a806e22895c5b7a6244e951c4f475a25184f8.tar.gz
vbados-0f0a806e22895c5b7a6244e951c4f475a25184f8.zip
add rescan option to redo automounts, in case user changes them
Diffstat (limited to 'sfmain.c')
-rw-r--r--sfmain.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/sfmain.c b/sfmain.c
index eadb7ae..bbd913b 100644
--- a/sfmain.c
+++ b/sfmain.c
@@ -319,6 +319,21 @@ static int unmount_all(LPTSRDATA data)
return err;
}
+static int rescan(LPTSRDATA data)
+{
+ int err;
+
+ if ((err = unmount_all(data))) {
+ return err;
+ }
+
+ if ((err = automount(data))) {
+ return err;
+ }
+
+ return 0;
+}
+
static int configure_driver(LPTSRDATA data)
{
unsigned i;
@@ -342,7 +357,6 @@ static int configure_driver(LPTSRDATA data)
printf("Using timezone from TZ variable (%s)\n", tzname[0]);
data->tz_offset = timezone / 2;
} else {
- printf("No TZ environment variable\n");
data->tz_offset = 0;
}
@@ -481,6 +495,7 @@ static void print_help(void)
" list list available shared folders\n"
" mount <FOLD> <X:> mount a shared folder into drive X:\n"
" umount <X:> unmount shared folder from drive X:\n"
+ " rescan unmount everything and recreate automounts\n"
);
}
@@ -525,8 +540,6 @@ int main(int argc, const char *argv[])
LPTSRDATA data = get_tsr_data(true);
int err, argi = 1;
- //printf("\nVBSF %x.%x\n", VERSION_MAJOR, VERSION_MINOR);
-
if (argi >= argc || stricmp(argv[argi], "install") == 0) {
bool high = true;
@@ -541,6 +554,8 @@ int main(int argc, const char *argv[])
}
}
+ printf("\nVBSharedFolders %x.%x\n", VERSION_MAJOR, VERSION_MINOR);
+
if (data) {
printf("VBSF already installed\n");
print_help();
@@ -596,6 +611,9 @@ int main(int argc, const char *argv[])
if (!drive) return invalid_arg(argv[argi]);
return unmount(data, drive);
+ } else if (stricmp(argv[argi], "rescan") == 0) {
+ if (!data) return driver_not_found();
+ return rescan(data);
} else {
return invalid_arg(argv[argi]);
}