Reset ACLs on the config directory and migrated config files

This commit is contained in:
Cameron Gutman 2023-04-29 22:37:38 -05:00
commit e8f3dfe32c

View file

@ -6,21 +6,25 @@ for %%I in ("%~dp0\..") do set "OLD_DIR=%%~fI"
rem Create the config directory if it didn't already exist
set "NEW_DIR=%OLD_DIR%\config"
if not exist "%NEW_DIR%\" mkdir "%NEW_DIR%"
icacls "%NEW_DIR%" /reset
rem Migrate all files that aren't already present in the config dir
if exist "%OLD_DIR%\apps.json" (
if not exist "%NEW_DIR%\apps.json" (
move "%OLD_DIR%\apps.json" "%NEW_DIR%\apps.json"
icacls "%NEW_DIR%\apps.json" /reset
)
)
if exist "%OLD_DIR%\sunshine.conf" (
if not exist "%NEW_DIR%\sunshine.conf" (
move "%OLD_DIR%\sunshine.conf" "%NEW_DIR%\sunshine.conf"
icacls "%NEW_DIR%\sunshine.conf" /reset
)
)
if exist "%OLD_DIR%\sunshine_state.json" (
if not exist "%NEW_DIR%\sunshine_state.json" (
move "%OLD_DIR%\sunshine_state.json" "%NEW_DIR%\sunshine_state.json"
icacls "%NEW_DIR%\sunshine_state.json" /reset
)
)